mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 03:55:46 +03:00
[slam] Avoid NULL pointer dereference in slam_pull_value()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -400,13 +400,17 @@ 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 );
|
||||||
|
|
||||||
|
/* Read value, if applicable */
|
||||||
|
if ( value ) {
|
||||||
*value = ( *data & 0x1f );
|
*value = ( *data & 0x1f );
|
||||||
while ( --len ) {
|
while ( --len ) {
|
||||||
*value <<= 8;
|
*value <<= 8;
|
||||||
*value |= *(++data);
|
*value |= *(++data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user