mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
b75b5f60ba
We process python args using PyArg_ParseTupleAndKeywords(), and use "p" type modifier there. According to documentation, this type modifier, while works for a boolean type, expects an argument of type int. But in py_net_join_member() and py_net_leave() we use argument of type uint8_t (no_dns_update, keep_account, r->in.debug). So when PyArg_ParseTupleAndKeywords() tries to assign a value to &no_dns_update, it updates subsequent, unrelated bytes too, - which ones depends on the stack and structure layout used by the compiler. Fix this by using int type for all relevant variables, and by introducing proxy variable "debug" (of the same type) for r->in.debug. While at it, also ensure all variables have sensible default values. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15078 Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed May 25 06:19:32 UTC 2022 on sn-devel-184 (backported from commit 976326fa2b6423ac5866af682605cf7584e4991a, cherry-pick -x with BUG: line added) Autobuild-User(v4-16-test): Jule Anger <janger@samba.org> Autobuild-Date(v4-16-test): Mon Aug 8 10:32:22 UTC 2022 on sn-devel-184