pytdbpack_pack_data: If the first argument to a 'B' code is not an
authorMartin Pool <mbp@samba.org>
Tue, 5 Nov 2002 21:22:14 +0000 (21:22 +0000)
committerMartin Pool <mbp@samba.org>
Tue, 5 Nov 2002 21:22:14 +0000 (21:22 +0000)
Integer, raise an error rather than just returning Null, which breaks
the interpreter.
(This used to be commit db67c5f7e53b231fe217a29a15888e8895ce2229)

source3/python/py_tdbpack.c

index c68d6f8c57eb266aae7a37b9fe1e302f35fa759d..1b3cbbceea3ce170ffc3bb92c920fc8f39a4bee7 100644 (file)
@@ -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);