diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-07 19:57:53 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-07 21:34:12 -0700 |
commit | 08c8b7a6ee4232c5a6614b8fc4aac2b337623de0 (patch) | |
tree | 843bf84f587586dd03dfde30c0d8074a43c5c3f0 | |
parent | f872b47cb606d448766c1fa750709fd06a8a6904 (diff) |
Improved error handling for corrupt intensity profiles
loadData.c:661:15: warning: Access to field 'value' results in a dereference of a null pointer (loaded from variable 'pIRec')
pIRec->value = tmp;
~~~~~ ^
loadData.c:682:19: warning: The right operand of '>' is a garbage value
if (++count > size) {
^ ~~~~
Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | loadData.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -634,6 +634,11 @@ ProcessIProfile(FILE *stream, XDCCC_Correction *pCorrection) state = 0; break; case DATA : + if(pIRec == NULL) { + fprintf(stderr, "Line %d: Invalid Intensity Profile -- Premature %s\n", + linenum, keyword); + return (0); + } do { /******************************************************** * Note: tableType should only be 0 or 1 at this point. |