Terminating null was written one byte past end of the buffer,
clobbering the dataWritten variable. Caused an assertion for whois
replies longer than BUFSIZ (1024) bytes.
/*
- * $Id: whois.cc,v 1.41 2007/04/28 22:26:38 hno Exp $
+ * $Id: whois.cc,v 1.42 2007/04/30 16:38:19 wessels Exp $
*
* DEBUG: section 75 WHOIS protocol
* AUTHOR: Duane Wessels, Kostas Anagnostakis
StoreEntry *entry;
HttpRequest *request;
FwdState::Pointer fwd;
- char buf[BUFSIZ];
+ char buf[BUFSIZ+1]; /* readReply adds terminating NULL */
bool dataWritten;
};
p->request = fwd->request;
p->entry = fwd->entry;
p->fwd = fwd;
- p->dataWritten = 0;
+ p->dataWritten = false;
p->entry->lock()
kb_incr(&statCounter.server.http.kbytes_in, len);
/* No range support, we always grab it all */
- dataWritten = 1;
+ dataWritten = true;
entry->append(buf, len);