[Pkg-wmaker-commits] [wmbiff] 10/14: regexes limit password and username to 32 characters

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:00:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to tag wmbiff_0_3_4
in repository wmbiff.

commit afc746f2e666d33d2129918192aaf3207158b1f7
Author: bluehal <bluehal>
Date:   Fri Nov 16 07:11:04 2001 +0000

    regexes limit password and username to 32 characters
---
 wmbiff/Imap4Client.c | 2 +-
 wmbiff/Pop3Client.c  | 6 +++---
 wmbiff/charutil.c    | 6 ++++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/wmbiff/Imap4Client.c b/wmbiff/Imap4Client.c
index ccd5ba3..3b25866 100644
--- a/wmbiff/Imap4Client.c
+++ b/wmbiff/Imap4Client.c
@@ -295,7 +295,7 @@ int imap4Create(Pop3 pc, const char *const str)
 {
 	struct re_registers regs;
 	const char *regex =
-		".*imaps?:([^:]+):([^@]+)@([^/: ]+)(/[^: ]+)?(:[0-9]+)? *";
+		".*imaps?:([^:]{1,32}):([^@]{1,32})@([^/: ]+)(/[^: ]+)?(:[0-9]+)? *";
 
 	/* IMAP4 format: imap:user:password at server/mailbox[:port] */
 	/* If 'str' line is badly formatted, wmbiff won't display the mailbox. */
diff --git a/wmbiff/Pop3Client.c b/wmbiff/Pop3Client.c
index fecd063..2162fc6 100644
--- a/wmbiff/Pop3Client.c
+++ b/wmbiff/Pop3Client.c
@@ -1,4 +1,4 @@
-/* $Id: Pop3Client.c,v 1.4 2001/11/16 01:13:36 bluehal Exp $ */
+/* $Id: Pop3Client.c,v 1.5 2001/11/16 07:11:04 bluehal Exp $ */
 /* Author : Scott Holden ( scotth at thezone.net )
    Modified : Yong-iL Joh ( tolkien at mizi.com )
    Modified : Jorge Garc�a ( Jorge.Garcia at uv.es )
@@ -168,8 +168,8 @@ int pop3Create(Pop3 pc, const char *str)
 	   use of '@' in passwords
 	 */
 	const char *regexes[] = {
-		"pop3:([^: ]+) ([^ ]+) ([^: ]+)( [0-9]+)? *",
-		"pop3:([^: ]+):([^@]+)@([^: ]+)(:[0-9]+)? *",
+		"pop3:([^: ]{1,32}) ([^ ]{1,32}) ([^: ]+)( [0-9]+)? *",
+		"pop3:([^: ]{1,32}):([^@]{1,32})@([^: ]+)(:[0-9]+)? *",
 		NULL
 	};
 
diff --git a/wmbiff/charutil.c b/wmbiff/charutil.c
index 59e406b..059823c 100644
--- a/wmbiff/charutil.c
+++ b/wmbiff/charutil.c
@@ -1,4 +1,4 @@
-/* $Id: charutil.c,v 1.5 2001/11/16 01:13:36 bluehal Exp $ */
+/* $Id: charutil.c,v 1.6 2001/11/16 07:11:04 bluehal Exp $ */
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -192,7 +192,9 @@ int compile_and_match_regex(const char *regex,
 
 	/* compile the regex pattern */
 	memset(&rpbuf, 0, sizeof(struct re_pattern_buffer));
-	re_syntax_options = RE_SYNTAX_EGREP;
+
+	/* posix egrep interprets intervals (eg. {1,32}) nicely */
+	re_syntax_options = RE_SYNTAX_POSIX_EGREP; 
 	errstr = re_compile_pattern(regex, strlen(regex), &rpbuf);
 	if (errstr != NULL) {
 		fprintf(stderr, "error in compiling regular expression: %s\n",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git



More information about the Pkg-wmaker-commits mailing list