summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-10 17:47:15 +0100
committerGünther Deschner <gd@samba.org>2012-12-12 09:42:32 +0100
commitff32391808322029a8d6caa9fdf1a4d253d9b1ff (patch)
tree3ad2c46bcdb87f8563fa72a7f34a4ce92f316b47 /source3
parent0f75d9274cff7095dfab251307231a5a911f0c8d (diff)
downloadsamba-ff32391808322029a8d6caa9fdf1a4d253d9b1ff.tar.gz
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.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c
index 3203e092e36..e51d3743208 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;