diff options
author | Volker Lendecke <vl@samba.org> | 2017-08-09 10:15:27 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2017-08-09 22:34:17 +0200 |
commit | 5c55c2563d04b563a7fd7027cf3128cb05b34fad (patch) | |
tree | 25f3493b9dcc3892d885daf1be43b6fdcd540bef /lib | |
parent | d55c27abc5a7357f740c7065bbe12e7f36b57125 (diff) | |
download | samba-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.c | 5 |
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; |