]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r334412: userboot: Fix bad type-punning
authorkevans <kevans@FreeBSD.org>
Wed, 20 Feb 2019 18:30:54 +0000 (18:30 +0000)
committerkevans <kevans@FreeBSD.org>
Wed, 20 Feb 2019 18:30:54 +0000 (18:30 +0000)
commit0777b3f0a366f58879e3d2c25dbc240a5a1d60ff
tree3ecae4b1a3b9a4cbd0a95f099fda65189065e5fd
parent214986293479574b25f4f9182d4f5a38f7216ad9
MFC r334412: userboot: Fix bad type-punning

Pass a struct devdesc to the format commands. Use proper type rather
than doing weird type-punning that happened to work because the size
was right. We copied a zfs devdesc into a disk_devdesc and then after
passing through a NULL pointer reinterpreted it as a
zfs_devdesc. Instead, pass the base devdesc around and 'upcase' when
we know the types are right.

This has the happy side effect of fixing a gcc warning about bad
type punning.
stand/userboot/userboot/devicename.c
stand/userboot/userboot/main.c