mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
registry: Add error checks to regdb_fetch_keys_internal
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
1fb2d10d38
commit
2a35cbb02f
@ -1784,7 +1784,23 @@ static WERROR regdb_fetch_keys_internal(struct db_context *db, const char *key,
|
||||
}
|
||||
|
||||
for (i=0; i<num_items; i++) {
|
||||
len += tdb_unpack(buf+len, buflen-len, "f", subkeyname);
|
||||
int this_len;
|
||||
|
||||
this_len = tdb_unpack(buf+len, buflen-len, "f", subkeyname);
|
||||
if (this_len == -1) {
|
||||
DBG_WARNING("Invalid registry data, "
|
||||
"tdb_unpack failed\n");
|
||||
werr = WERR_INTERNAL_DB_CORRUPTION;
|
||||
goto done;
|
||||
}
|
||||
len += this_len;
|
||||
if (len < this_len) {
|
||||
DBG_WARNING("Invalid registry data, "
|
||||
"integer overflow\n");
|
||||
werr = WERR_INTERNAL_DB_CORRUPTION;
|
||||
goto done;
|
||||
}
|
||||
|
||||
werr = regsubkey_ctr_addkey(ctr, subkeyname);
|
||||
if (!W_ERROR_IS_OK(werr)) {
|
||||
DEBUG(5, ("regdb_fetch_keys: regsubkey_ctr_addkey "
|
||||
|
Loading…
Reference in New Issue
Block a user