← Commit list

9ec836c03

Denys Vlasenko
Denys Vlasenko
2019-12-03
SUCCESS Duration: 151s

Subject

whois: limit total length of response to 32+2 kb

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/whois.c+3 -1
@@ -53,7 +53,9 @@ static char *query(const char *host, int port, const char *domain)
fp = xfdopen_for_read(fd);
success = 0;
- while (fgets(linebuf, sizeof(linebuf)-1, fp)) {
+ while (bufpos < 32*1024 /* paranoia */
+ && fgets(linebuf, sizeof(linebuf)-1, fp)
+ ) {
unsigned len;
len = strcspn(linebuf, "\r\n");