Re: [PATCH v2 1/3] util: Introduce virAcpi module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <abologna@xxxxxxxxxx>

-- 
Andrea Bolognani / Red Hat / Virtualization




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux