From: Szymon Janc <szymon.janc@tieto.com>
To: Dohyun Pyun <dh79.pyun@samsung.com>
Cc: linux-bluetooth@vger.kernel.org,
grzegorz.kolodziejczyk@tieto.com, steve.jun@samsung.com
Subject: Re: [PATCH BLUEZ] tools/bneptest: Fix not NULL terminating parsed string
Date: Wed, 29 Jul 2015 09:29:50 +0200 [thread overview]
Message-ID: <1549921.uu7jjHlb6V@leonov> (raw)
In-Reply-To: <1438150734-25746-1-git-send-email-dh79.pyun@samsung.com>
Hi Dohyun Pyun,
On Wednesday 29 of July 2015 15:18:54 Dohyun Pyun wrote:
> From: DoHyun Pyun <dh79.pyun@samsung.com>
>
> This patch prevents the possible not NULL terminating problem.
> ifr_name's array size is IFNAMSIZ. So If bridge has IFNAMSIZ size,
> the name string will be not NULL terminating.
> ---
> tools/bneptest.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/bneptest.c b/tools/bneptest.c
> index a7d5815..1404252 100644
> --- a/tools/bneptest.c
> +++ b/tools/bneptest.c
> @@ -89,7 +89,7 @@ static int set_forward_delay(int sk)
> struct ifreq ifr;
>
> memset(&ifr, 0, sizeof(ifr));
> - strncpy(ifr.ifr_name, bridge, IFNAMSIZ);
> + strncpy(ifr.ifr_name, bridge, IFNAMSIZ - 1);
> ifr.ifr_data = (char *) args;
>
> if (ioctl(sk, SIOCDEVPRIVATE, &ifr) < 0) {
Applied, thanks.
--
BR
Szymon Janc
prev parent reply other threads:[~2015-07-29 7:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-29 6:18 [PATCH BLUEZ] tools/bneptest: Fix not NULL terminating parsed string Dohyun Pyun
2015-07-29 7:29 ` Szymon Janc [this message]
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=1549921.uu7jjHlb6V@leonov \
--to=szymon.janc@tieto.com \
--cc=dh79.pyun@samsung.com \
--cc=grzegorz.kolodziejczyk@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=steve.jun@samsung.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;
as well as URLs for NNTP newsgroup(s).