Re: [PATCH 2/2] entity: Fix osinfo_entity_get_param_value_int64_with_default

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

 



On Thu, Nov 22, 2012 at 4:32 PM, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote:
> The way it's currently implemented,
> osinfo_entity_get_param_value_int64_with_default will return the
> default value if the value which is being parsed is negative.
> This happens because it tries to reuse osinfo_entity_get_param_value_int64
> to do the parsing, which returns -1 when the value could not be found.
> However, we have no way of knowing if the -1 means that the value could
> not be found, or if this means the value was found and its value is -1.
> This is made worse by the fact that we return the default value as
> soon as osinfo_entity_get_param_value_int64 returns a negative value,
> not just -1.
>
> By implementing osinfo_entity_get_param_value_int64 by calling
> osinfo_entity_get_param_value_int64_with_default rather than doing the
> contrary, we can avoid this issue.

ACK

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124


[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux