summaryrefslogtreecommitdiffstats
path: root/source3/python
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2002-11-05 21:22:14 +0000
committerMartin Pool <mbp@samba.org>2002-11-05 21:22:14 +0000
commit17356de9211fdcf49a54ebfa143c3c9519a74edf (patch)
treeb3f72476d3870a0fcb96ac5a67ec84a814e32d30 /source3/python
parent31124420b7aa712adb478053894a14efde0a7c97 (diff)
downloadsamba-17356de9211fdcf49a54ebfa143c3c9519a74edf.tar.gz
samba-17356de9211fdcf49a54ebfa143c3c9519a74edf.tar.xz
samba-17356de9211fdcf49a54ebfa143c3c9519a74edf.zip
pytdbpack_pack_data: If the first argument to a 'B' code is not an
Integer, raise an error rather than just returning Null, which breaks the interpreter. (This used to be commit db67c5f7e53b231fe217a29a15888e8895ce2229)
Diffstat (limited to 'source3/python')
-rw-r--r--source3/python/py_tdbpack.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/python/py_tdbpack.c b/source3/python/py_tdbpack.c
index c68d6f8c57e..1b3cbbceea3 100644
--- a/source3/python/py_tdbpack.c
+++ b/source3/python/py_tdbpack.c
@@ -661,8 +661,10 @@ pytdbpack_pack_data(const char *format_str,
long size;
char *sval;
- if (!PyInt_Check(val_obj))
+ if (!PyInt_Check(val_obj)) {
+ pytdbpack_bad_type(ch, "Integer", val_obj);
return NULL;
+ }
size = PyInt_AsLong(val_obj);
pack_uint32(size, &packed);