summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_winreg_nt.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source3/rpc_server/srv_winreg_nt.c b/source3/rpc_server/srv_winreg_nt.c
index c45be08454..23b594ac78 100644
--- a/source3/rpc_server/srv_winreg_nt.c
+++ b/source3/rpc_server/srv_winreg_nt.c
@@ -163,7 +163,6 @@ static BOOL get_value_information( REGISTRY_KEY *key, uint32 *maxnum,
uint32 *maxlen, uint32 *maxsize )
{
REGVAL_CTR *values;
- REGISTRY_VALUE *val;
uint32 sizemax, lenmax;
int i, num_values;
@@ -178,15 +177,17 @@ static BOOL get_value_information( REGISTRY_KEY *key, uint32 *maxnum,
lenmax = sizemax = 0;
num_values = regval_ctr_numvals( values );
-
- val = regval_ctr_specific_value( values, 0 );
-
- for ( i=0; i<num_values && val; i++ )
- {
- lenmax = MAX(lenmax, val->valuename ? strlen(val->valuename)+1 : 0 );
+
+ for ( i=0; i<num_values; i++ ) {
+ REGISTRY_VALUE *val;
+
+ if (!(val = regval_ctr_specific_value( values, i ))) {
+ break;
+ }
+
+ lenmax = MAX(lenmax, val->valuename ?
+ strlen(val->valuename)+1 : 0 );
sizemax = MAX(sizemax, val->size );
-
- val = regval_ctr_specific_value( values, i );
}
*maxnum = num_values;