Merge pull request from GHSA-mg26-v6qh-x48q

v1.26
Brad House 9 months ago
parent 63755385d1
commit 4082760583
  1. 8
      src/lib/ares__read_line.c

@ -59,6 +59,14 @@ ares_status_t ares__read_line(FILE *fp, char **buf, size_t *bufsize)
return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF;
}
len = offset + ares_strlen(*buf + offset);
/* Probably means there was an embedded NULL as the first character in
* the line, throw away line */
if (len == 0) {
offset = 0;
continue;
}
if ((*buf)[len - 1] == '\n') {
(*buf)[len - 1] = 0;
break;

Loading…
Cancel
Save