mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
getdata: report position in config file when parsing fails
It seems that one can reach the abort() with severely broken configuration file, that is extremely unlikely to run without parser error when given to ISC dhcpd. So such files ought to be impossible, and it is good enough for this software to report position where parsing cannot be continued. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
ae2edb0fbc
commit
a905b50943
1 changed files with 3 additions and 2 deletions
|
|
@ -257,8 +257,9 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
break;
|
||||
} else if (argument == ITS_A_RANGE_SECOND_IP && i == 0) {
|
||||
if (!range_p) {
|
||||
puts("parse_config: range_p uninitialized: report a bug");
|
||||
abort();
|
||||
fpos_t pos;
|
||||
fgetpos(dhcpd_config, &pos);
|
||||
error(EXIT_FAILURE, 0, "parse_config: parsing failed at position: %Ld", pos);
|
||||
}
|
||||
range_p->last_ip = range_p->first_ip;
|
||||
goto newrange;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue