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.
This commit is contained in:
Joel Sherrill
2010-01-20 17:10:36 +00:00
parent f659921bd2
commit 04fee3104e
2 changed files with 17 additions and 0 deletions

View File

@@ -1,3 +1,10 @@
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

View File

@@ -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);