mirror of
https://github.com/ipxe/ipxe
synced 2026-02-02 07:52:48 +03:00
[smbios] Avoid reading beyond end of constructed SMBIOS setting
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -130,6 +130,13 @@ static int smbios_fetch ( struct settings *settings __unused,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Limit length */
|
||||||
|
if ( tag_offset > sizeof ( buf ) ) {
|
||||||
|
tag_len = 0;
|
||||||
|
} else if ( ( tag_offset + tag_len ) > sizeof ( buf ) ) {
|
||||||
|
tag_len = ( sizeof ( buf ) - tag_offset );
|
||||||
|
}
|
||||||
|
|
||||||
/* Mangle UUIDs if necessary. iPXE treats UUIDs as
|
/* Mangle UUIDs if necessary. iPXE treats UUIDs as
|
||||||
* being in network byte order (big-endian). SMBIOS
|
* being in network byte order (big-endian). SMBIOS
|
||||||
* specification version 2.6 states that UUIDs are
|
* specification version 2.6 states that UUIDs are
|
||||||
|
|||||||
Reference in New Issue
Block a user