pytalloc: Fix comparison of disparate types
commit8ac9c860de3b902855a00d7589b8a614eec3de45
authorPetr Viktorin <pviktori@redhat.com>
Fri, 6 Mar 2015 17:57:00 +0000 (6 18:57 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 23 Apr 2015 23:50:11 +0000 (24 01:50 +0200)
tree11591b4480bd51835534a1559e221625ad0c0879
parent51ae17b0703eaa481d602ffc7d8231a629fcb5fd
pytalloc: Fix comparison of disparate types

When fed Python objects of different types, pytalloc_default_cmp
compared pointers to PyType objects that weren't part of an array,
resulting in undefined behavior.

This makes things a bit better (though it still casts ptrdiff_t to int).

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/talloc/pytalloc.c