bk: 5465c90dVRkNdoFoI_Qy5njl2AgDTg
+* [Sec 2630] buffer overrun in ntpq tokenize().
* [Bug 2661] ntpq crashes with mreadvar.
(4.2.7p477) 2014/11/13 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 2657] Document that "restrict nopeer" intereferes with "pool".
if (*ntok == 1 && tokens[0][0] == ':') {
do {
+ if (sp - tspace >= MAXLINE)
+ goto toobig;
*sp++ = *cp++;
} while (!ISEOL(*cp));
}
else if (*cp == '\"') {
++cp;
do {
+ if (sp - tspace >= MAXLINE)
+ goto toobig;
*sp++ = *cp++;
} while ((*cp != '\"') && !ISEOL(*cp));
/* HMS: a missing closing " should be an error */
}
else {
do {
+ if (sp - tspace >= MAXLINE)
+ goto toobig;
*sp++ = *cp++;
} while ((*cp != '\"') && !ISSPACE(*cp) && !ISEOL(*cp));
/* HMS: Why check for a " in the previous line? */
}
+ if (sp - tspace >= MAXLINE)
+ goto toobig;
*sp++ = '\0';
}
+ return;
+
+ toobig:
+ *ntok = 0;
+ fprintf(stderr,
+ "***Line `%s' is too big\n",
+ line);
+ return;
}