summaryrefslogtreecommitdiff
path: root/source4/lib/registry/reg_backend_nt4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-04-11 16:37:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:13 -0500
commitc60c5ebb910a77f6f3f345093794637714eb66e2 (patch)
tree91e9e3200ed7400e9c5f8791270ca2ab84fdcd62 /source4/lib/registry/reg_backend_nt4
parent07afafd45df34c4617c9e3e31bcd3130a9e255e3 (diff)
downloadsamba-c60c5ebb910a77f6f3f345093794637714eb66e2.tar.gz
samba-c60c5ebb910a77f6f3f345093794637714eb66e2.tar.bz2
samba-c60c5ebb910a77f6f3f345093794637714eb66e2.zip
r166: Fix enumerating values in nt4 backend
(This used to be commit 1a7de762c60177b6e250f81cdeb3466fce148bff)
Diffstat (limited to 'source4/lib/registry/reg_backend_nt4')
-rw-r--r--source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
index 9d90523a75..a7e5051ce4 100644
--- a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
+++ b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
@@ -1697,12 +1697,16 @@ static WERROR nt_value_by_index(REG_KEY *k, int n, REG_VAL **value)
{
VL_TYPE *vl;
int val_off, vk_off;
+ int val_count;
VK_HDR *vk_hdr;
REGF *regf = k->handle->backend_data;
NK_HDR *nk_hdr = k->backend_data;
+ val_count = IVAL(&nk_hdr->val_cnt,0);
val_off = IVAL(&nk_hdr->val_off,0);
vl = (VL_TYPE *)LOCN(regf->base, val_off);
DEBUG(2, ("Val List Offset: %0X\n", val_off));
+ if(n < 0) return WERR_INVALID_PARAM;
+ if(n >= val_count) return WERR_NO_MORE_ITEMS;
vk_off = IVAL(&vl[n],0);
vk_hdr = (VK_HDR *)LOCN(regf->base, vk_off);