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: Evan Tang <etang110@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Evan Tang 2020-01-27 02:13:41 -06:00 committed by Alexandre Julliard
parent 47f3abb633
commit 4e9dae3776
1 changed files with 1 additions and 1 deletions

View File

@ -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);