diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-10-13 15:36:58 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-10-13 15:36:58 +0000 |
commit | 3bdaed0431fd2a2dcb274afe6bc2a3e9173bc3e0 (patch) | |
tree | 6916ccbdef5f38a37cda6ab8877ecbee19a09f41 /usr.sbin/hostapd/parse.y | |
parent | 04984848d99631fdf31cf2d682075614db7c50c3 (diff) |
check error condition of strtonum
Diffstat (limited to 'usr.sbin/hostapd/parse.y')
-rw-r--r-- | usr.sbin/hostapd/parse.y | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/hostapd/parse.y b/usr.sbin/hostapd/parse.y index 317093aab2e..d6b66d5768b 100644 --- a/usr.sbin/hostapd/parse.y +++ b/usr.sbin/hostapd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.25 2006/09/28 17:06:54 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.26 2006/10/13 15:36:57 reyk Exp $ */ /* * Copyright (c) 2004, 2005, 2006 Reyk Floeter <reyk@openbsd.org> @@ -1011,7 +1011,13 @@ randaddr : RANDOM number : STRING { - $$ = strtonum($1, 0, LONG_MAX, NULL); + const char *errstr; + $$ = strtonum($1, 0, LONG_MAX, &errstr); + if (errstr) { + yyerror("invalid number: %s", $1); + free($1); + YYERROR; + } free($1); } ; |