From 6a8fdefe5177ee689ddec17e3bc6a5f0834cfcc4 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Wed, 3 Jun 2020 09:20:50 +0100 Subject: [PATCH] wmbiff: parse IMAP configuration on FreeBSD The upper limit of a bounded repetition is given by RE_DUP_MAX, which is 255 on FreeBSD (and OpenBSD), but 32,767 on Linux, so this should suffice: --- wmbiff/wmbiff/Imap4Client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wmbiff/wmbiff/Imap4Client.c b/wmbiff/wmbiff/Imap4Client.c index 14c48d0..5b54ce4 100644 --- a/wmbiff/wmbiff/Imap4Client.c +++ b/wmbiff/wmbiff/Imap4Client.c @@ -498,8 +498,8 @@ int imap4Create( /*@notnull@ */ Pop3 *pc, const char *const str) /* special characters aren't allowed in hostnames, rfc 1034 */ const char *regexes[] = { // type : username : password @ hostname (/ name)?(:port)? - ".*imaps?:([^: ]{1,32}):([^@]{0,32})@([A-Za-z1-9][-A-Za-z0-9_.]+)(/(\"[^\"]+\")|([^:@ ]+))?(:[0-9]+)?( *([CcAaPp][-A-Za-z5 ]*))?$", - ".*imaps?:([^: ]{1,32}) ([^ ]{1,32}) ([A-Za-z1-9][-A-Za-z0-9_.]+)(/(\"[^\"]+\")|([^: ]+))?( [0-9]+)?( *([CcAaPp][-A-Za-z5 ]*))?$", + ".*imaps?:([^: ]{1,255}):([^@]{0,32})@([A-Za-z1-9][-A-Za-z0-9_.]+)(/(\"[^\"]+\")|([^:@ ]+))?(:[0-9]+)?( *([CcAaPp][-A-Za-z5 ]*))?$", + ".*imaps?:([^: ]{1,255}) ([^ ]{1,32}) ([A-Za-z1-9][-A-Za-z0-9_.]+)(/(\"[^\"]+\")|([^: ]+))?( [0-9]+)?( *([CcAaPp][-A-Za-z5 ]*))?$", NULL }; char *unaliased_str; -- 2.11.4.GIT