X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Freq.c;h=da8e3f0d8ffb463082a314762f4e1635bc2bc809;hb=01bb89b0e602cfcc259f90388eb8e06834b60c48;hp=a3e727390948601f8300e63cda1e7a20c7e4e346;hpb=4d2dc22a9a68395a5788ae66c84ae0ced2d0e733;p=ashd.git diff --git a/lib/req.c b/lib/req.c index a3e7273..da8e3f0 100644 --- a/lib/req.c +++ b/lib/req.c @@ -106,12 +106,16 @@ int parseheaders(struct hthead *head, FILE *in) { int c, state; struct charbuf name, val; + size_t tsz; bufinit(name); bufinit(val); state = 0; + tsz = 0; while(1) { c = fgetc(in); + if(++tsz >= 65536) + goto fail; again: if(state == 0) { if(c == '\r') {