regedit: Don't crash if REG_SZ is empty.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de> Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
84d2d7818b
commit
8e9a469e9c
|
@ -1243,11 +1243,12 @@ static size_t export_value_name(FILE *fp, WCHAR *name, size_t len, BOOL unicode)
|
||||||
|
|
||||||
static void export_string_data(WCHAR **buf, WCHAR *data, size_t size)
|
static void export_string_data(WCHAR **buf, WCHAR *data, size_t size)
|
||||||
{
|
{
|
||||||
size_t len, line_len;
|
size_t len = 0, line_len;
|
||||||
WCHAR *str;
|
WCHAR *str;
|
||||||
static const WCHAR fmt[] = {'"','%','s','"',0};
|
static const WCHAR fmt[] = {'"','%','s','"',0};
|
||||||
|
|
||||||
len = size / sizeof(WCHAR) - 1;
|
if (size)
|
||||||
|
len = size / sizeof(WCHAR) - 1;
|
||||||
str = REGPROC_escape_string(data, len, &line_len);
|
str = REGPROC_escape_string(data, len, &line_len);
|
||||||
*buf = heap_xalloc((line_len + 3) * sizeof(WCHAR));
|
*buf = heap_xalloc((line_len + 3) * sizeof(WCHAR));
|
||||||
sprintfW(*buf, fmt, str);
|
sprintfW(*buf, fmt, str);
|
||||||
|
|
Loading…
Reference in New Issue