diff options
author | Andreas Schneider <asn@samba.org> | 2012-12-10 17:47:15 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2012-12-12 09:42:32 +0100 |
commit | ff32391808322029a8d6caa9fdf1a4d253d9b1ff (patch) | |
tree | 3ad2c46bcdb87f8563fa72a7f34a4ce92f316b47 /source3 | |
parent | 0f75d9274cff7095dfab251307231a5a911f0c8d (diff) | |
download | samba-ff32391808322029a8d6caa9fdf1a4d253d9b1ff.tar.gz samba-ff32391808322029a8d6caa9fdf1a4d253d9b1ff.tar.bz2 samba-ff32391808322029a8d6caa9fdf1a4d253d9b1ff.zip |
s3-registry: Check return code of push_reg_sz().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/registry/reg_perfcount.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c index 3203e092e3..e51d374320 100644 --- a/source3/registry/reg_perfcount.c +++ b/source3/registry/reg_perfcount.c @@ -158,6 +158,7 @@ static uint32 _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb, char *buf1 = *retbuf; uint32 working_size = 0; DATA_BLOB name_index, name; + bool ok; memset(temp, 0, sizeof(temp)); snprintf(temp, sizeof(temp), "%d", keyval); @@ -178,7 +179,11 @@ static uint32 _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb, buffer_size = 0; return buffer_size; } - push_reg_sz(talloc_tos(), &name_index, (const char *)kbuf.dptr); + ok = push_reg_sz(talloc_tos(), &name_index, (const char *)kbuf.dptr); + if (!ok) { + buffer_size = 0; + return buffer_size; + } memcpy(buf1+buffer_size, (char *)name_index.data, working_size); buffer_size += working_size; /* Now encode the actual name */ @@ -191,7 +196,11 @@ static uint32 _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb, memset(temp, 0, sizeof(temp)); memcpy(temp, dbuf.dptr, dbuf.dsize); SAFE_FREE(dbuf.dptr); - push_reg_sz(talloc_tos(), &name, temp); + ok = push_reg_sz(talloc_tos(), &name, temp); + if (!ok) { + buffer_size = 0; + return buffer_size; + } memcpy(buf1+buffer_size, (char *)name.data, working_size); buffer_size += working_size; |