Commit bfc60dfb authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Compute dwLen after passing the string through

REGPROC_unescape_string() so we don't save garbage characters in the registry.
parent a501ea73
......@@ -397,14 +397,17 @@ HRESULT setValue(LPSTR val_name, LPSTR val_data)
if ( dwParseType == REG_SZ) /* no conversion for string */
{
REGPROC_unescape_string(val_data);
/* Compute dwLen after REGPROC_unescape_string because it may
* have changed the string length and we don't want to store
* the extra garbage in the registry.
*/
dwLen = strlen(val_data);
if (dwLen>0 && val_data[dwLen-1]=='"')
{
dwLen--;
val_data[dwLen]='\0';
}
dwLen++;
REGPROC_unescape_string(val_data);
lpbData = val_data;
} else if (dwParseType == REG_DWORD) /* Convert the dword types */
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment