diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2019-03-21 10:55:42 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2019-03-21 10:55:42 +0000 |
commit | 80c4fdbfbde2043f3f22522b5fdc9c9ef7d962af (patch) | |
tree | 707943f39146f805279a801363f051bb2b99e9f2 /usr.sbin/sasyncd | |
parent | d818d1a7b34a7889d586738ad99c42138b8c6f90 (diff) |
Fix IPv6 address parsing and skipping of comment lines followed by blank
lines; Found while investigating a diff from Michal Koc; ok kn@
Diffstat (limited to 'usr.sbin/sasyncd')
-rw-r--r-- | usr.sbin/sasyncd/conf.y | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/sasyncd/conf.y b/usr.sbin/sasyncd/conf.y index 868063c1f5b..0b6731c19b5 100644 --- a/usr.sbin/sasyncd/conf.y +++ b/usr.sbin/sasyncd/conf.y @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.y,v 1.19 2017/04/09 02:40:24 jsg Exp $ */ +/* $OpenBSD: conf.y,v 1.20 2019/03/21 10:55:41 otto Exp $ */ /* * Copyright (c) 2005 Håkan Olsson. All rights reserved. @@ -325,7 +325,7 @@ yylex(void) /* Numerical token? */ if (isdigit(*confptr)) { for (p = confptr; *p; p++) - if (*p == '.') /* IP address, or bad input */ + if (*p == '.' || *p == ':') /* IP address, or bad input */ goto is_string; v = (int)strtol(confptr, (char **)NULL, 10); yylval.val = v; @@ -397,6 +397,9 @@ conf_parse_file(char *cfgfile) if (*s == '#') { while (*s != '\n' && s < buf + conflen) s++; + while (*s == '\n' && s < buf + conflen) + s++; + s--; continue; } if (d == buf && isspace(*s)) |