pytdb: Fix repr segfault for internal db
authorKirill Smelkov <kirr@mns.spb.ru>
Sun, 19 Sep 2010 09:53:21 +0000 (13:53 +0400)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 19 Sep 2010 16:31:20 +0000 (09:31 -0700)
commit277a1b229cf1b456560a50d021e2eaf2158e5134
tree1098dfcb844e84aee2eb4d12f0a9d6ede88f5d4b
parentc4b1971259638875317aa991b6a119b668ac03a8
pytdb: Fix repr segfault for internal db

The problem was tdb->name is NULL for TDB_INTERNAL databases, and
so it was crashing ...

    #0  0xb76944f3 in strlen () from /lib/i686/cmov/libc.so.6
    #1  0x0809862b in PyString_FromFormatV (format=0xb72b6a26 "Tdb('%s')", vargs=0xbfc26a94 "")
        at ../Objects/stringobject.c:211
    #2  0x08098888 in PyString_FromFormat (format=0xb72b6a26 "Tdb('%s')") at ../Objects/stringobject.c:358
    #3  0xb72b65f2 in tdb_object_repr (self=0xb759e060) at ./pytdb.c:439

Cc: 597089@bugs.debian.org
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
lib/tdb/pytdb.c
lib/tdb/python/tests/simple.py