OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
951a43c
)
android/pan: Fix not NULL terminating parsed string
author
DoHyun Pyun
<dh79.pyun@samsung.com>
Wed, 29 Jul 2015 06:24:48 +0000
(15:24 +0900)
committer
Szymon Janc
<szymon.janc@tieto.com>
Wed, 29 Jul 2015 07:26:00 +0000
(09:26 +0200)
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.
android/pan.c
patch
|
blob
|
history
diff --git
a/android/pan.c
b/android/pan.c
index
0bb576e
..
c40a6d3
100644
(file)
--- 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) {