OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8360fb0
)
Staging: ozwpan: Fix null dereference
author
Salym Senyonga
<salymsash@gmail.com>
Sat, 25 Jan 2014 09:54:39 +0000
(12:54 +0300)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 7 Feb 2014 17:15:35 +0000
(09:15 -0800)
If net_dev is NULL memcpy() will Oops.
Signed-off-by: Salym Senyonga <salymsash@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ozwpan/ozproto.c
patch
|
blob
|
history
diff --git
a/drivers/staging/ozwpan/ozproto.c
b/drivers/staging/ozwpan/ozproto.c
index
cb06036
..
5d965cf
100644
(file)
--- a/
drivers/staging/ozwpan/ozproto.c
+++ b/
drivers/staging/ozwpan/ozproto.c
@@
-668,8
+668,8
@@
void oz_binding_add(const char *net_dev)
if (binding) {
binding->ptype.type = __constant_htons(OZ_ETHERTYPE);
binding->ptype.func = oz_pkt_recv;
- memcpy(binding->name, net_dev, OZ_MAX_BINDING_LEN);
if (net_dev && *net_dev) {
+ memcpy(binding->name, net_dev, OZ_MAX_BINDING_LEN);
oz_dbg(ON, "Adding binding: %s\n", net_dev);
binding->ptype.dev =
dev_get_by_name(&init_net, net_dev);
@@
-680,6
+680,7
@@
void oz_binding_add(const char *net_dev)
}
} else {
oz_dbg(ON, "Binding to all netcards\n");
+ memset(binding->name, 0, OZ_MAX_BINDING_LEN);
binding->ptype.dev = NULL;
}
if (binding) {