projects
/
project
/
firewall3.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't mistreat unknown protocol names as "any protocol"
[project/firewall3.git]
/
options.c
diff --git
a/options.c
b/options.c
index
5a7a901
..
6f96681
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;
{
struct fw3_protocol proto = { };
struct protoent *ent;
+ char *e;
if (*val == '!')
{
if (*val == '!')
{
@@
-556,9
+557,9
@@
fw3_parse_protocol(void *ptr, const char *val, bool is_list)
return true;
}
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);
return false;
put_value(ptr, &proto, sizeof(proto), is_list);