[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] line length limit in ct_check plugin



I was checking the wrong .c file. I have now patched pcre.c
with the following patch. This might be useful for others.

--- pcre.c.dist	Fri Sep 19 11:59:20 2003
+++ pcre.c	Wed Jan 28 14:47:40 2004
@@ -71,8 +71,8 @@
 {
 	struct _cfg **cfgp=(struct _cfg **)priv;
 	int rc,count=0;
-	char buf[128];
-	char fbuf[128];
+	char buf[512];
+	char fbuf[512];
 	FILE *fp;
 	int options;
 	char *eob,*p,*q,*re,*comm;
@@ -91,6 +91,11 @@
 	}
 	while (fgets(buf,sizeof(buf),fp)) {
 		count++;
+		if (buf[0] && buf[strlen(buf)-1] != '\n') {
+			ERRLOG((LOG_ERR,
+				"pcre: %d(%d): Line too long",fbuf,count));
+			return 1;
+		}
 		if (buf[0] == '#') continue;
 		buf[sizeof(buf)-1]='\0';
 		p=buf+strlen(buf)-1;
-- 
Ambrose LI Cheuk-Wing  <a.c.li@ieee.org>

http://ada.dhs.org/~acli/
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi