diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-01-20 14:31:04 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-01-20 14:31:04 +0000 |
commit | 129b4a38bddff949178c0fa59a50aa0c6cbfac68 (patch) | |
tree | 8a0b1a10899becfa2c570839de64f9caacaa618c /cpukit/libmisc | |
parent | 2010-01-20 Chris Johns <chrisj@rtems.org> (diff) | |
download | rtems-129b4a38bddff949178c0fa59a50aa0c6cbfac68.tar.bz2 |
2010-01-20 Chris Johns <chrisj@rtems.org>
Coverity Id 6
* libmisc/shell/hexdump-parse.c: Modify conditional to avoid NULL
dereference.
Diffstat (limited to 'cpukit/libmisc')
-rw-r--r-- | cpukit/libmisc/shell/hexdump-parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cpukit/libmisc/shell/hexdump-parse.c b/cpukit/libmisc/shell/hexdump-parse.c index 1fc06c0efa..945314cb0f 100644 --- a/cpukit/libmisc/shell/hexdump-parse.c +++ b/cpukit/libmisc/shell/hexdump-parse.c @@ -230,8 +230,10 @@ rewrite(rtems_shell_hexdump_globals* globals, FS *fs) err(exit_jump, 1, NULL); if (!fu->nextpr) fu->nextpr = pr; - else - *nextpr = pr; + else { + if (nextpr) + *nextpr = pr; + } /* Skip preceding text and up to the next % sign. */ for (p1 = fmtp; *p1 && *p1 != '%'; ++p1); |