diff options
Diffstat (limited to 'cpukit/libblock/src/bdpart.c')
-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); |