tdb: Avoid NULL tdb_write
authorVolker Lendecke <vl@samba.org>
Wed, 9 Aug 2017 08:16:36 +0000 (10:16 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 9 Aug 2017 20:34:17 +0000 (22:34 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/tdb/common/tdb.c

index 6beda22..04f7f97 100644 (file)
@@ -619,6 +619,10 @@ static int _tdb_storev(struct tdb_context *tdb, TDB_DATA key,
        ofs += key.dsize;
 
        for (i=0; i<num_dbufs; i++) {
+               if (dbufs[i].dsize == 0) {
+                       continue;
+               }
+
                ret = tdb->methods->tdb_write(tdb, ofs, dbufs[i].dptr,
                                              dbufs[i].dsize);
                if (ret == -1) {