]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ntlm_fake_auth: Fix nesting error
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 30 Nov 2012 13:18:30 +0000 (06:18 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 30 Nov 2012 13:18:30 +0000 (06:18 -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 8f5a6411c852cfe6243cd6a6fb221bf486f5547a..a6fff195d709abf1b2ffe5d7e4b09a6fdd5b99cd 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";