Jelajahi Sumber

check_nrpe = segfault when specifying a config file

Fix for issue #112
John C. Frickson 9 tahun lalu
induk
melakukan
7348ba3a82
2 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 1 0
      Changelog
  2. 2 2
      src/check_nrpe.c

+ 1 - 0
Changelog

@@ -6,6 +6,7 @@ x.x.x - xxxx-xx-xx
 ------------------
 FIXES
 - The '--log-file=' or '-g' option is missing from the help (John Frickson)
+- check_nrpe = segfault when specifying a config file (John Frickson)
 
 
 3.1.0 - 2017-04-17

+ 2 - 2
src/check_nrpe.c

@@ -558,10 +558,10 @@ int read_config_file(char *fname)
 
 	bufp = buf;
 	while (argc < 50) {
+		while (*bufp && strchr(delims, *bufp))
+			++bufp;
 		if (*bufp == '\0')
 			break;
-		while (strchr(delims, *bufp))
-			++bufp;
 		argv[argc] = my_strsep(&bufp, delims);
 		if (!argv[argc++])
 			break;