usr.sbin/makefs/hammer2: Fix assert bug when running ioctl commands
commit70e962f72e588a76ccc2d1efabbe00ff5a7203a5
authorTomohiro Kusumi <tkusumi@netbsd.org>
Mon, 19 Jun 2023 04:02:33 +0000 (18 21:02 -0700)
committerTomohiro Kusumi <tkusumi@netbsd.org>
Mon, 19 Jun 2023 04:19:26 +0000 (18 21:19 -0700)
tree1081d00407ffcfe9e20bc19f7a0805eea0a4cddd
parent4fe5868fa32487c95ba2e8c844125b91b9843b06
usr.sbin/makefs/hammer2: Fix assert bug when running ioctl commands

The dir pointer should be NULL when running HAMMER2 ioctl command
with "--" for directory, and in that case assert(dir!=NULL) in common
paths are wrong.

Only seen this on OpenBSD which means only OpenBSD had NULL for
an uninitialized pointer in stack.

--
assertion "dir != NULL" failed: file "hammer2.c", line 269, function "hammer2_makefs"
assertion "dir != NULL" failed: file "hammer2.c", line 658, function "hammer2_validate"
usr.sbin/makefs/hammer2.c
usr.sbin/makefs/makefs.c