diff options
author | Thomas Jarosch <tomj@simonv.com> | 2015-01-13 21:57:24 +0100 |
---|---|---|
committer | Thomas Jarosch <tomj@simonv.com> | 2015-01-13 21:57:24 +0100 |
commit | 2ee2a9697a1cea6ca3b9fa328440b8f46aa84fd8 (patch) | |
tree | 8f19d94810148cb1a775dca8c07a1997023bd5fb | |
parent | 1212edd352e924111bb3db6330755b33f13fbe71 (diff) | |
download | rockbox-2ee2a9697a1cea6ca3b9fa328440b8f46aa84fd8.tar.gz rockbox-2ee2a9697a1cea6ca3b9fa328440b8f46aa84fd8.zip |
Fix crash on uninitialized variable
The WRITE() macro checks if the "fw" pointer
is open upon fwrite() error. Since fw was
not initialized before use, it might crash for non-zero fw.
cppcheck reported.
[utils/jz4740_tools/HXFreplace.c:187]: (error) Uninitialized variable: fw
Change-Id: I558170f9f17828c9fd515a5da36ad8b5cb30a9ad
-rw-r--r-- | utils/jz4740_tools/HXFreplace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/jz4740_tools/HXFreplace.c b/utils/jz4740_tools/HXFreplace.c index bcfff82540..5a05525194 100644 --- a/utils/jz4740_tools/HXFreplace.c +++ b/utils/jz4740_tools/HXFreplace.c | |||
@@ -107,7 +107,7 @@ static int checksum(FILE *file) | |||
107 | 107 | ||
108 | int main(int argc, char *argv[]) | 108 | int main(int argc, char *argv[]) |
109 | { | 109 | { |
110 | FILE *infile, *outfile, *fw; | 110 | FILE *infile, *outfile, *fw = NULL; |
111 | 111 | ||
112 | fprintf(stderr, "HXFreplace v" VERSION " - (C) 2008 Maurus Cuelenaere\n"); | 112 | fprintf(stderr, "HXFreplace v" VERSION " - (C) 2008 Maurus Cuelenaere\n"); |
113 | fprintf(stderr, "This is free software; see the source for copying conditions. There is NO\n"); | 113 | fprintf(stderr, "This is free software; see the source for copying conditions. There is NO\n"); |