1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-24 20:53:22 +02:00

[package] iptables: fix segfault in xtables_parse_protocol() if an unknown protocol is specified for -p

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15573 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2009-05-03 14:31:36 +00:00
parent e8ca01dae1
commit 948e5eb524

View File

@ -0,0 +1,13 @@
diff -ur iptables-1.4.3.2.orig/xtables.c iptables-1.4.3.2/xtables.c
--- iptables-1.4.3.2.orig/xtables.c 2009-05-03 16:17:53.000000000 +0200
+++ iptables-1.4.3.2/xtables.c 2009-05-03 16:27:37.000000000 +0200
@@ -1502,7 +1502,8 @@
else {
unsigned int i;
for (i = 0; i < ARRAY_SIZE(xtables_chain_protos); ++i) {
- if (strcmp(s, xtables_chain_protos[i].name) == 0) {
+ if ((xtables_chain_protos[i].name != NULL) &&
+ (strcmp(s, xtables_chain_protos[i].name) == 0)) {
proto = xtables_chain_protos[i].num;
break;
}