mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-07 10:27:44 +02:00
- And update for more spare space.
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
- 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.
|
||||
delimiter after the character. And update for more spare space.
|
||||
|
||||
6 January 2020: George
|
||||
- Downgrade compat/getentropy_solaris.c to version 1.4 from OpenBSD.
|
||||
|
||||
+4
-4
@@ -120,7 +120,7 @@ sldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *l
|
||||
if (line_nr) {
|
||||
*line_nr = *line_nr + 1;
|
||||
}
|
||||
if (limit > 0 && (i+1 > limit || (size_t)(t-token)+1 > limit)) {
|
||||
if (limit > 0 && (i+1 >= limit || (size_t)(t-token)+1 >= limit)) {
|
||||
*t = '\0';
|
||||
return -1;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ sldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *l
|
||||
i++;
|
||||
}
|
||||
/* is there space for the character and the zero after it */
|
||||
if (limit > 0 && (i+1 > limit || (size_t)(t-token)+1 > limit)) {
|
||||
if (limit > 0 && (i+1 >= limit || (size_t)(t-token)+1 >= limit)) {
|
||||
*t = '\0';
|
||||
return -1;
|
||||
}
|
||||
@@ -328,7 +328,7 @@ sldns_bget_token_par(sldns_buffer *b, char *token, const char *delim,
|
||||
/* do not write ' ' if we want to skip spaces */
|
||||
if(!(skipw && (strchr(skipw, c)||strchr(skipw, ' ')))) {
|
||||
/* 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)) {
|
||||
if (limit > 0 && (i+1 >= limit || (size_t)(t-token)+1 >= limit)) {
|
||||
*t = '\0';
|
||||
return -1;
|
||||
}
|
||||
@@ -355,7 +355,7 @@ sldns_bget_token_par(sldns_buffer *b, char *token, const char *delim,
|
||||
}
|
||||
|
||||
i++;
|
||||
if (limit > 0 && (i+1 > limit || (size_t)(t-token)+1 > limit)) {
|
||||
if (limit > 0 && (i+1 >= limit || (size_t)(t-token)+1 >= limit)) {
|
||||
*t = '\0';
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user