- Fix 'make test' to work for --disable-sha1 configure option.
- Fix out-of-bounds null-byte write in sldns_bget_token_par while
parsing type WKS, reported by Luis Merino from X41 D-Sec.
+ - Updated sldns_bget_token_par fix for also space for the zero
+ delimiter after the character.
6 January 2020: George
- Downgrade compat/getentropy_solaris.c to version 1.4 from OpenBSD.
if (line_nr) {
*line_nr = *line_nr + 1;
}
- if (limit > 0 && (i > limit || (size_t)(t-token) > limit)) {
+ if (limit > 0 && (i+1 > limit || (size_t)(t-token)+1 > limit)) {
*t = '\0';
return -1;
}
if (c != '\0' && c != '\n') {
i++;
}
- if (limit > 0 && (i > limit || (size_t)(t-token) > limit)) {
+ /* is there space for the character and the zero after it */
+ if (limit > 0 && (i+1 > limit || (size_t)(t-token)+1 > limit)) {
*t = '\0';
return -1;
}
/* in parentheses */
/* do not write ' ' if we want to skip spaces */
if(!(skipw && (strchr(skipw, c)||strchr(skipw, ' ')))) {
- /* check for space for the space character */
- if (limit > 0 && (i > limit || (size_t)(t-token) > limit)) {
+ /* check for space for the space character and a zero delimiter after that. */
+ if (limit > 0 && (i+1 > limit || (size_t)(t-token)+1 > limit)) {
*t = '\0';
return -1;
}
}
i++;
- if (limit > 0 && (i > limit || (size_t)(t-token) > limit)) {
+ if (limit > 0 && (i+1 > limit || (size_t)(t-token)+1 > limit)) {
*t = '\0';
return -1;
}