X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=lib%2Freq.c;h=da8e3f0d8ffb463082a314762f4e1635bc2bc809;hp=a3e727390948601f8300e63cda1e7a20c7e4e346;hb=90b0ba0f9d93e454cc08a566b718abdcbfd0d9f6;hpb=aa7e44069384016c57c417904bb45f6fa554981a 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') {