projects
/
project
/
firewall3.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
098b7d6
)
Don't mistreat unknown protocol names as "any protocol"
author
Jo-Philipp Wich
<jow@openwrt.org>
Tue, 18 Jun 2013 14:26:11 +0000
(16:26 +0200)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Tue, 18 Jun 2013 14:26:11 +0000
(16:26 +0200)
options.c
patch
|
blob
|
history
diff --git
a/options.c
b/options.c
index 5a7a901a6433d47b032b9a7e01b0ba3900b2d947..6f96681561cbeec9b782da075dab1880a8568400 100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-518,6
+518,7
@@
fw3_parse_protocol(void *ptr, const char *val, bool is_list)
{
struct fw3_protocol proto = { };
struct protoent *ent;
+ char *e;
if (*val == '!')
{
@@
-556,9
+557,9
@@
fw3_parse_protocol(void *ptr, const char *val, bool is_list)
return true;
}
- proto.protocol = strtoul(val,
NULL
, 10);
+ proto.protocol = strtoul(val,
&e
, 10);
- if (
errno == ERANGE || errno == EINVAL
)
+ if (
(e == val) || (*e != 0)
)
return false;
put_value(ptr, &proto, sizeof(proto), is_list);