* OverrideRequest(): for some reason Hdr->HR.ReqLine can be NULL here, we need to...
authorWilfried Göesgens <willi@citadel.org>
Thu, 6 May 2010 18:40:08 +0000 (18:40 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 6 May 2010 18:40:08 +0000 (18:40 +0000)
webcit/context_loop.c

index 34233ef417f13adc96e0e930aef6da788823f0ae..1525e91a574d1476e45661e53c09c99a540ffc52 100644 (file)
@@ -444,8 +444,13 @@ void OverrideRequest(ParsedHttpHdrs *Hdr, const char *Line, long len)
 {
        StrBuf *Buf = NewStrBuf();
 
-       FlushStrBuf(Hdr->HR.ReqLine);
-       StrBufPlain(Hdr->HR.ReqLine, Line, len);
+       if (Hdr->HR.ReqLine != NULL) {
+               FlushStrBuf(Hdr->HR.ReqLine);
+               StrBufPlain(Hdr->HR.ReqLine, Line, len);
+       }
+       else {
+               Hdr->HR.ReqLine = NewStrBufPlain(Line, len);
+       }
        ReadHttpSubject(Hdr, Hdr->HR.ReqLine, Buf);
 
        FreeStrBuf(&Buf);