lkml.org 
[lkml]   [2012]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 4/4] tools: hv: Parse /etc/os-release
Date


> -----Original Message-----
> From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk]
> Sent: Wednesday, September 05, 2012 12:58 PM
> To: KY Srinivasan
> Cc: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
> ben@decadent.org.uk; thozza@redhat.com; dcbw@redhat.com
> Subject: Re: [PATCH 4/4] tools: hv: Parse /etc/os-release
>
> > + if (!strcmp(buf, "NAME"))
> > + os_name = strdup(value);
> > + else if (!strcmp(buf, "VERSION_ID"))
> > + os_major = strdup(value);
>
> strdup can fail. The case where it leaks because NAME= occurs twice is
> harmless enough but the strdup ought to be checked or add an x_strdup()
> helper.

I will fix this and resend this patch.

Thank you,

K. Y





\
 
 \ /
  Last update: 2012-09-05 21:02    [W:0.070 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site