[slam] Avoid NULL pointer dereference in slam_pull_value()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
60561d0f3d
commit
64de7dc7fd
|
@ -400,12 +400,16 @@ static int slam_pull_value ( struct slam_request *slam,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read value */
|
/* Strip value */
|
||||||
iob_pull ( iobuf, len );
|
iob_pull ( iobuf, len );
|
||||||
*value = ( *data & 0x1f );
|
|
||||||
while ( --len ) {
|
/* Read value, if applicable */
|
||||||
*value <<= 8;
|
if ( value ) {
|
||||||
*value |= *(++data);
|
*value = ( *data & 0x1f );
|
||||||
|
while ( --len ) {
|
||||||
|
*value <<= 8;
|
||||||
|
*value |= *(++data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Reference in New Issue