Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 May 2021 15:49:07 GMT
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 0367371f7457 - main - www/hypermail: add a patch to fix memory issues
Message-ID:  <202105191549.14JFn791048752@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0367371f745716ba6e9eca552c935fc8d88f1fb3

commit 0367371f745716ba6e9eca552c935fc8d88f1fb3
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2021-05-19 13:56:19 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2021-05-19 15:49:04 +0000

    www/hypermail: add a patch to fix memory issues
---
 www/hypermail/Makefile                 |  2 +-
 www/hypermail/files/patch-memory-fixes | 60 ++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/www/hypermail/Makefile b/www/hypermail/Makefile
index 28c023683bf6..c4e7700a519b 100644
--- a/www/hypermail/Makefile
+++ b/www/hypermail/Makefile
@@ -3,7 +3,7 @@
 PORTNAME=	hypermail
 PORTVERSION=	2.4.0
 DISTVERSIONPREFIX=	v
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	www mail
 
 MAINTAINER=	bapt@FreeBSD.org
diff --git a/www/hypermail/files/patch-memory-fixes b/www/hypermail/files/patch-memory-fixes
new file mode 100644
index 000000000000..8e4df362ea77
--- /dev/null
+++ b/www/hypermail/files/patch-memory-fixes
@@ -0,0 +1,60 @@
+diff --git src/parse.c src/parse.c
+index 36da5df..679514c 100644
+--- src/parse.c
++++ src/parse.c
+@@ -924,7 +924,7 @@ static char *mdecodeRFC2047(char *string, int length, char *charsetsave)
+     char charset[129];
+     char encoding[33];
+     char dummy[129];
+-    char *ptr;
++    char *ptr, *endptr;
+     char *old_output;
+ 
+ #ifdef NOTUSED
+@@ -959,6 +959,7 @@ static char *mdecodeRFC2047(char *string, int length, char *charsetsave)
+ 
+ 	    if (!strcasecmp("q", encoding)) {
+ 		/* quoted printable decoding */
++            endptr = ptr + strlen(ptr);
+ 
+ #ifdef HAVE_ICONV
+ 	      char *orig2,*output2,*output3;
+@@ -967,7 +968,7 @@ static char *mdecodeRFC2047(char *string, int length, char *charsetsave)
+ 	      memset(output2,0,strlen(string)+1);
+ 	      old_output=output;
+ 
+-		for (; *ptr; ptr++) {
++		for (; ptr < endptr; ptr++) {
+ 		    switch (*ptr) {
+ 		    case '=':
+ 			sscanf(ptr + 1, "%02X", &value);
+@@ -991,7 +992,7 @@ static char *mdecodeRFC2047(char *string, int length, char *charsetsave)
+ 		memcpy(charsetsave,charset,charsetlen);
+ 		charsetsave[charsetlen] = '\0';
+ #else
+-		for (; *ptr; ptr++) {
++		for (; ptr < endptr; ptr++) {
+ 		    switch (*ptr) {
+ 		    case '=':
+ 			sscanf(ptr + 1, "%02X", &value);
+@@ -2378,6 +2379,7 @@ int parsemail(char *mbox,	/* file name */
+ #endif
+                                     if (charset) {
+                                         free(charset);
++					charset = NULL;
+                                     }
+                                     charsetsave[0] = '\0';
+ 
+diff --git src/uudecode.c src/uudecode.c
+index 4b4310d..f5a7c20 100644
+--- src/uudecode.c
++++ src/uudecode.c
+@@ -75,7 +75,7 @@ int uudecode(FILE *input,	/* get file data from (if needed) */
+     if (init) {
+ 	/* search for header line */
+ 	/* AUDIT biege: BOF in buf! */
+-	sprintf(scanfstring, "begin %%o %%%us", sizeof(buf));
++	sprintf(scanfstring, "begin %%o %%%us", sizeof(buf) -1);
+ 	while (2 != sscanf(iptr, scanfstring, &mode, buf)) {
+ 	    if (!fgets(buf, MAXPATHLEN, input)) {
+ 		return 2;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105191549.14JFn791048752>