]> git.ipfire.org Git - thirdparty/shadow.git/commit
tests/unit/test_xasprintf.c: Fix use of volatile pointer
authorAlejandro Colomar <alx@kernel.org>
Fri, 28 Jun 2024 11:57:35 +0000 (13:57 +0200)
committerSerge Hallyn <serge@hallyn.com>
Fri, 28 Jun 2024 13:57:01 +0000 (08:57 -0500)
commit6e57238bf915f8c6cfa0a2497c7311e760cae148
tree523348214a153282b33b7a03a2c210744f3aee3d
parent3307a8f4f0aca3ed470930ec1239189beb03f2b5
tests/unit/test_xasprintf.c: Fix use of volatile pointer

volatile needs to be casted away behind a [[gnu::noipa]] function, to
make that invisible to the compiler.  Otherwise, the compiler can see
that it is being discarded, and is free to abuse Undefined Behavior.

Closes: <https://github.com/shadow-maint/shadow/issues/1028>
Reported-by: Chris Hofstaedtler <zeha@debian.org>
Tested-by: Chris Hofstaedtler <zeha@debian.org>
Reviewed-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
tests/unit/test_xasprintf.c