diff options
-rw-r--r-- | cpukit/ChangeLog | 7 | ||||
-rw-r--r-- | cpukit/libblock/src/bdpart.c | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 587dc4bfa7..2cbe894341 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,12 @@ 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. + +2010-01-20 Joel Sherrill <joel.sherrill@oarcorp.com> + Coverity Id 5 * score/src/objectextendinformation.c: Check object_blocks for NULL to determine when to allocate object block table. 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); |