Commit 4e9dae37 authored by Evan Tang's avatar Evan Tang Committed by Alexandre Julliard

kernel32/lzexpand: Fix uninitialized read in read_header.

read_header calls _lread which can either return the number of characters read or HFILE_ERROR (-1), cast to a UINT. Signed-off-by: 's avatarEvan Tang <etang110@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 47f3abb6
......@@ -139,7 +139,7 @@ static INT read_header(HFILE fd,struct lzfileheader *head)
/* We can't directly read the lzfileheader struct due to
* structure element alignment
*/
if (_lread(fd,buf,LZ_HEADER_LEN)<LZ_HEADER_LEN)
if (_lread(fd,buf,LZ_HEADER_LEN) != LZ_HEADER_LEN)
return 0;
memcpy(head->magic,buf,LZ_MAGIC_LEN);
memcpy(&(head->compressiontype),buf+LZ_MAGIC_LEN,1);
......
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