Check for buffer overflows on data returns from RegQueryValueExA.

This commit is contained in:
Marcus Meissner 2000-10-13 17:04:14 +00:00 committed by Alexandre Julliard
parent c6f0a4ed87
commit c0e3db958d
1 changed files with 5 additions and 1 deletions

View File

@ -923,7 +923,11 @@ DWORD WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD
}
total_size = len + info_size;
}
else if (data) memcpy( data, buf_ptr + info_size, total_size - info_size );
else if (data)
{
if (total_size - info_size > *count) status = STATUS_BUFFER_OVERFLOW;
else memcpy( data, buf_ptr + info_size, total_size - info_size );
}
}
else if (status != STATUS_BUFFER_OVERFLOW) goto done;
}