]> git.ipfire.org Git - thirdparty/samba.git/commit
python:build: do not allow sizeof(int) != 4
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 29 May 2025 00:58:48 +0000 (12:58 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Tue, 26 Aug 2025 22:42:39 +0000 (22:42 +0000)
commit812998b15ff9130d8f7139e20ac61ac75e68eff0
tree9bdb1c36ed74d122eba572215046ebb60d32991a
parent499656a05011a462b2e44faea7318a02c847de5e
python:build: do not allow sizeof(int) != 4

A non-32 bit int will (if the compiler allows it) result in code
where we write into memory adjacent to a target uint32_t value in
many python bindings using the python arg-parsing API. The more
correct thing to do would be to always parse into an unsigned long
long and error if it is greater than UINT32_MAX, but we do this in
so many places that there is reason to believe we'll just keep
adding more.

Note, we already check in lib/replace/wscript that int is at least
32 bits; here we are effectively just checking that it is not more.

There was apparently a version of 64 bit Solaris in the 1990s that
had 64 bit ints.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
python/wscript