At 10:54 AM 08/04/2001 +0100, you wrote:
I've found time to do some more digging, but I'm still stumped.
<snip>
I have browsed server/registry.c and it seems that the registry stores a terminating null for strings; so if you have in the registry file a string like "0123456789", it get in memory a length of 11. So I guess that the fix would be to fix the length by -1 somewhere in the path server->ntdll->advapi
I have tried this but I am not sure at all this is correct :
--- registry.c.orig Mon Mar 5 20:34:21 2001 +++ registry.c Sun Apr 8 18:11:39 2001 @@ -799,14 +799,17 @@ struct key_value *value; int index; size_t ret = 0; + size_t l;
if ((value = find_value( key, name, &index ))) { *type = value->type; - *len = value->len; - if (value->data && offset < value->len) + l = value->len; + if ((value->type == REG_SZ) && l) l--; + *len = l; + if (value->data && offset < l) { - if (maxlen > value->len - offset) maxlen = value->len - offset; + if (maxlen > l - offset) maxlen = l - offset; memcpy( data, (char *)value->data + offset, maxlen ); ret = maxlen; }
Gerard
On Sun, 08 Apr 2001, you wrote:
At 10:54 AM 08/04/2001 +0100, you wrote:
I've found time to do some more digging, but I'm still stumped.
<snip>
I have browsed server/registry.c and it seems that the registry stores a terminating null for strings; so if you have in the registry file a string like "0123456789", it get in memory a length of 11. So I guess that the fix would be to fix the length by -1 somewhere in the path server->ntdll->advapi
I have tried this but I am not sure at all this is correct :
{...}
Well it solves the problem, thanks.
So there are at least *three* places where null-termination of text strings are handled!