projects
/
oweals
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fbb4a83
)
netifd: Fix possible segfault in bridge code
author
Helmut Schaa
<helmut.schaa@googlemail.com>
Fri, 29 Nov 2013 14:22:34 +0000
(15:22 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Fri, 29 Nov 2013 14:33:44 +0000
(15:33 +0100)
Need to check calloc result. In case of failure the bridge member will be missing.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
bridge.c
patch
|
blob
|
history
diff --git
a/bridge.c
b/bridge.c
index 0e06cc264b0439a4e1dd50f43bfe2229b351cacd..4ef0d7e20940587e324291c6a1df45ef926d2298 100644
(file)
--- a/
bridge.c
+++ b/
bridge.c
@@
-318,6
+318,9
@@
bridge_create_member(struct bridge_state *bst, struct device *dev, bool hotplug)
struct bridge_member *bm;
bm = calloc(1, sizeof(*bm) + strlen(dev->ifname) + 1);
+ if (!bm)
+ return NULL;
+
bm->bst = bst;
bm->dev.cb = bridge_member_cb;
bm->dev.hotplug = hotplug;