From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "K. Y. Srinivasan" <kys@microsoft.com>
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
Date: Wed, 5 Sep 2012 17:58:10 +0100 [thread overview]
Message-ID: <20120905175810.60ee45c8@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <1346864553-30059-4-git-send-email-kys@microsoft.com>
> + 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.
Alan
next prev parent reply other threads:[~2012-09-05 16:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-05 17:01 [PATCH 0/4] Tools: hv K. Y. Srinivasan
2012-09-05 17:02 ` [PATCH 1/4] tools: hv: Fix file handle leak K. Y. Srinivasan
2012-09-05 17:02 ` [PATCH 2/4] tools: hv: Fix exit() error code K. Y. Srinivasan
2012-09-05 17:02 ` [PATCH 3/4] tools: hv: Check for read/write errors K. Y. Srinivasan
2012-09-05 17:02 ` [PATCH 4/4] tools: hv: Parse /etc/os-release K. Y. Srinivasan
2012-09-05 16:58 ` Alan Cox [this message]
2012-09-05 18:16 ` KY Srinivasan
2012-09-05 19:11 ` [PATCH 0/4] Tools: hv Greg KH
2012-09-05 19:24 ` KY Srinivasan
2012-09-05 19:38 ` Greg KH
2012-09-05 19:49 ` KY Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120905175810.60ee45c8@pyramind.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=apw@canonical.com \
--cc=ben@decadent.org.uk \
--cc=dcbw@redhat.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=thozza@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®