mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 13:10:28 +00:00
Check for buffer overflows on data returns from RegQueryValueExA.
This commit is contained in:
parent
c6f0a4ed87
commit
c0e3db958d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user