]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4861: HTTPMSGLOCK missing pointer safety (#228)
authorAmos Jeffries <yadij@users.noreply.github.com>
Tue, 3 Jul 2018 13:04:43 +0000 (01:04 +1200)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sun, 8 Jul 2018 14:04:24 +0000 (02:04 +1200)
src/HttpMsg.h

index 34f7a624fbbafe70c138f191ee0ed52861e7dce1..1694f136a932af610e208155a94dcaccd23943ea 100644 (file)
@@ -104,7 +104,7 @@ protected:
 int httpMsgIsolateHeaders(const char **parse_start, int len, const char **blk_start, const char **blk_end);
 
 #define HTTPMSGUNLOCK(a) if (a) { if ((a)->unlock() == 0) delete (a); (a)=NULL; }
-#define HTTPMSGLOCK(a) (a)->lock()
+#define HTTPMSGLOCK(a) if (a) { (a)->lock(); }
 
 #endif /* SQUID_HTTPMSG_H */