summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2017-08-09 10:15:27 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-08-09 22:34:17 +0200
commit5c55c2563d04b563a7fd7027cf3128cb05b34fad (patch)
tree25f3493b9dcc3892d885daf1be43b6fdcd540bef /lib
parentd55c27abc5a7357f740c7065bbe12e7f36b57125 (diff)
downloadsamba-5c55c2563d04b563a7fd7027cf3128cb05b34fad.tar.gz
tdb: Consistency check for tdb_storev
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/tdb/common/tdb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tdb/common/tdb.c b/lib/tdb/common/tdb.c
index a67d8fb50c9..6beda222a4e 100644
--- a/lib/tdb/common/tdb.c
+++ b/lib/tdb/common/tdb.c
@@ -541,6 +541,11 @@ static int _tdb_storev(struct tdb_context *tdb, TDB_DATA key,
for (i=0; i<num_dbufs; i++) {
size_t dsize = dbufs[i].dsize;
+ if ((dsize != 0) && (dbufs[i].dptr == NULL)) {
+ tdb->ecode = TDB_ERR_EINVAL;
+ goto fail;
+ }
+
dbufs_len += dsize;
if (dbufs_len < dsize) {
tdb->ecode = TDB_ERR_OOM;