]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ntlm_fake_auth: Fix nesting error
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 15 Nov 2012 09:00:29 +0000 (02:00 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 15 Nov 2012 09:00:29 +0000 (02:00 -0700)
Broken macro wrapping leads to the fake authenticator sending bad
responses to Squid. This can ead to users being rejected by the fake
helper whose purpose is to accept everything.

 Detected by Coverity Scan. Issue 740394

helpers/ntlm_auth/fake/ntlm_fake_auth.cc

index a5363194ec470c46819972423ed0d90b5a331449..a7bf0732fb7bd3f54877ac7224397c33d08bc0ba 100644 (file)
 #endif
 
 /* A couple of harmless helper macros */
-#define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n");
+#define SEND(X) {debug("sending '%s' to squid\n",X); printf(X "\n");}
 #ifdef __GNUC__
-#define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);
-#define SEND4(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);
+#define SEND2(X,Y...) {debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);}
+#define SEND4(X,Y...) {debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);}
 #else
 /* no gcc, no debugging. varargs macros are a gcc extension */
-#define SEND2(X,Y) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);
-#define SEND4(X,Y,Z,W) debug("sending '" X "' to squid\n",Y,Z,W); printf(X "\n",Y,Z,W);
+#define SEND2(X,Y) {debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);}
+#define SEND4(X,Y,Z,W) {debug("sending '" X "' to squid\n",Y,Z,W); printf(X "\n",Y,Z,W);}
 #endif
 
 const char *authenticate_ntlm_domain = "WORKGROUP";