Merge pull request from GHSA-mg26-v6qh-x48q

pull/706/head
Brad House 9 months ago committed by GitHub
parent 035c4c3776
commit a804c04ddc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  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