]> wimlib.net Git - wimlib/commit
mount_image.c: avoid UBSAN warning in wimfs_listxattr()
authorEric Biggers <ebiggers3@gmail.com>
Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)
commit652fdb6b8513bd726b447b121dca93784b2b5d73
treed34e38f86d1d2f0700eb43b07ec083920c6eefca
parentf62f022dcfdbb0669bfe6d96a41628d16ee612c7
mount_image.c: avoid UBSAN warning in wimfs_listxattr()

When 'list == NULL && size == 0', the statement 'end = list + size'
executes 'NULL + 0'.  clang's UndefinedBehaviorSanitizer complains that
this is undefined:

    src/mount_image.c:1518:19: runtime error: applying zero offset to null pointer

This is questionable, but let's avoid it...
src/mount_image.c