s3/libsmb/py: match input argument types with C types
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 7 Feb 2019 04:04:43 +0000 (17:04 +1300)
committerNoel Power <npower@samba.org>
Fri, 8 Feb 2019 12:31:38 +0000 (13:31 +0100)
commit96cdacae1475847fa5005370a4fcb5fcacfb4dbc
tree828275883e8824950a7b4f7ccf880b09919749dd
parent8294e68a4175e6116b38869866c42a1b7ba55b6a
s3/libsmb/py: match input argument types with C types

If PyArg_ParseTupleAndKeywords() is given, say, an "H" format (meaning
unsigned short int) but the referenced variable is a plain unsigned
int, the top 16 bits of the variable will be left undefined. In that
case we should use an "I" format (and/or initialize the variable).

In many cases the change is fairly innocuous, such as when "i" and "I"
are mixed (for signed and unsigned ints respectively), but the
resulting write is the same size and probably gives the same result in
practice.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
source3/libsmb/pylibsmb.c