[rhel6-branch] Skip comments in dmidecode output (#1064701)

David Shea dshea at redhat.com
Wed Feb 19 20:17:28 UTC 2014


On 02/19/2014 02:51 PM, Brian C. Lane wrote:
>   
> +        p = sn+strlen(sn)-1;
> +        if (*p = '\n')
> +            *p = '\0';
> +
>

Last nitpick, I promise: dmidecode returns an empty string on stdout on 
error, so we should still check for that here. Only check for *p == '\n' 
if strlen(sn) > 0 (or if p >= sn if you prefer) so we don't read before 
the start of sn.


More information about the anaconda-patches mailing list