On Thu, Apr 06, 2023 at 10:57:02AM +0200, Michal Privoznik wrote:
> +++ b/src/util/viracpi.c
> + /* Basic sanity check. While there's a type specific data
> + * that follows the node header, the node length should be at
> + * least size of header itself. */
> + if (nodeHeader->len < sizeof(*nodeHeader)) {
> + virReportError(VIR_ERR_INTERNAL_ERROR,
> + _("IORT table node type %1$s has invalid length:
> %2$u"),
> + NULLSTR(typeStr), (unsigned int)nodeHeader->len);
As mentioned in the other thread, consider changing this to
virReportError(VIR_ERR_INTERNAL_ERROR,
_("IORT table node type %1$s has invalid length: got
%2$u, expected at least %3$lu"),
NULLSTR(typeStr), (unsigned int)nodeHeader->len,
sizeof(*nodeHeader));
for a slightly more useful error message.
Either way,
Reviewed-by: Andrea Bolognani <[email protected]>
--
Andrea Bolognani / Red Hat / Virtualization