Evan Tang : kernel32/lzexpand: Fix uninitialized read in read_header.
Alexandre Julliard
julliard at winehq.org
Mon Jan 27 15:00:24 CST 2020
Module: wine
Branch: master
Commit: 4e9dae37767462c531f489fab13980f210b32da6
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4e9dae37767462c531f489fab13980f210b32da6
Author: Evan Tang <etang110 at gmail.com>
Date: Mon Jan 27 02:13:41 2020 -0600
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 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/lzexpand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/kernel32/lzexpand.c b/dlls/kernel32/lzexpand.c
index 4b2ec2ed45..73c9ddc031 100644
--- a/dlls/kernel32/lzexpand.c
+++ b/dlls/kernel32/lzexpand.c
@@ -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);
More information about the wine-cvs
mailing list