diff options
author | DoHyun Pyun <dh79.pyun@samsung.com> | 2015-07-29 15:24:48 +0900 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2015-07-29 09:26:00 +0200 |
commit | a5e8a0f2e956bd5a16d09889fc62618674811f3d (patch) | |
tree | 372ed1edc56b5f3faf4956ab4d81b29cc5b0bf75 /android | |
parent | 951a43cf99d845d398442fa75b36c0d638dbea3b (diff) | |
download | bluez-a5e8a0f2e956bd5a16d09889fc62618674811f3d.tar.gz |
android/pan: Fix not NULL terminating parsed string
This patch prevents the possible not NULL terminating problem.
ifr_name's array size is IFNAMSIZ. So If BNEP_BRIDGE has IFNAMSIZ size,
the name string will be not NULL terminating.
Diffstat (limited to 'android')
-rw-r--r-- | android/pan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/android/pan.c b/android/pan.c index 0bb576e9f..c40a6d3e7 100644 --- a/android/pan.c +++ b/android/pan.c @@ -88,7 +88,7 @@ static int set_forward_delay(int sk) struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, BNEP_BRIDGE, IFNAMSIZ); + strncpy(ifr.ifr_name, BNEP_BRIDGE, IFNAMSIZ - 1); ifr.ifr_data = (char *) args; if (ioctl(sk, SIOCDEVPRIVATE, &ifr) < 0) { |