Messages in this thread | | | From | KY Srinivasan <> | Subject | RE: [PATCH 4/4] tools: hv: Parse /etc/os-release | Date | Wed, 5 Sep 2012 18:16:56 +0000 |
| |
> -----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
| |