diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-01-20 17:10:36 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-01-20 17:10:36 +0000 |
commit | 04fee3104edf1cb695f4a377626754467dfcd6b0 (patch) | |
tree | ebe3237b479a441f379e255dbfe2db9fa66ffa7f /cpukit/libblock | |
parent | 2010-01-20 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-04fee3104edf1cb695f4a377626754467dfcd6b0.tar.bz2 |
2010-01-20 Joel Sherrill <joel.sherrill@oarcorp.com>
Coverity Id 7
Coverity Id 8
* libblock/src/bdpart.c: Verify libblock is really set after
rtems_bdbuf_read() before using it.
Diffstat (limited to 'cpukit/libblock')
-rw-r--r-- | cpukit/libblock/src/bdpart.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cpukit/libblock/src/bdpart.c b/cpukit/libblock/src/bdpart.c index 7cecea85ad..d2e4ad30e1 100644 --- a/cpukit/libblock/src/bdpart.c +++ b/cpukit/libblock/src/bdpart.c @@ -271,6 +271,11 @@ static rtems_status_code rtems_bdpart_read_record( return sc; } + /* just in case block did not get filled in */ + if ( *block == NULL ) { + return RTEMS_INVALID_ADDRESS; + } + /* Check MBR signature */ if (!rtems_bdpart_is_valid_record( (*block)->buffer)) { return RTEMS_IO_ERROR; @@ -301,6 +306,11 @@ static rtems_status_code rtems_bdpart_new_record( return sc; } + /* just in case block did not get filled in */ + if ( *block == NULL ) { + return RTEMS_INVALID_ADDRESS; + } + /* Clear record */ memset( (*block)->buffer, 0, RTEMS_BDPART_BLOCK_SIZE); |