diff options
author | ache <ache@FreeBSD.org> | 1998-06-28 17:50:22 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1998-06-28 17:50:22 +0000 |
commit | 51af38215bebb068af18abcba150223eb5acef1d (patch) | |
tree | e634c7963cc02b81f9eca66bfc7ccdb04eed52bf | |
parent | 9b953b6638874e1a532f1d8a20e20663a8aa9871 (diff) | |
download | FreeBSD-ports-51af38215bebb068af18abcba150223eb5acef1d.zip FreeBSD-ports-51af38215bebb068af18abcba150223eb5acef1d.tar.gz |
Fix broken code that people tries to commit again and again despite the
fact that I am this port maintainer and still alive.
-rw-r--r-- | mail/popper/files/patch-ag | 52 | ||||
-rw-r--r-- | mail/popper/files/patch-ah | 60 |
2 files changed, 61 insertions, 51 deletions
diff --git a/mail/popper/files/patch-ag b/mail/popper/files/patch-ag index c40dc52..bf573ea 100644 --- a/mail/popper/files/patch-ag +++ b/mail/popper/files/patch-ag @@ -16,54 +16,4 @@ ((int *)ap)[3],((int *)ap)[4],((int *)ap)[5]); # endif va_end(ap); ---- pop_msg.c.orig Wed Nov 19 13:20:38 1997 -+++ pop_msg.c Sun Jun 28 01:35:05 1998 -@@ -27,6 +27,7 @@ - { - POP * p; - int stat; /* POP status indicator */ -+ int l, len; /* remaining buffer length */ - char * format; /* Format string for the message */ - va_list ap; - register char * mp; -@@ -50,6 +51,7 @@ - - /* Point to the message buffer */ - mp = message; -+ len = sizeof(message); - - /* Format the POP status code at the beginning of the message */ - if (stat == POP_SUCCESS) -@@ -58,17 +60,18 @@ - (void)sprintf (mp,"%s ",POP_ERR); - - /* Point past the POP status indicator in the message message */ -- mp += strlen(mp); -+ l = strlen(mp); -+ len -= l, mp += l; - - /* Append the message (formatted, if necessary) */ - if (format) - #ifdef HAVE_VPRINTF -- vsprintf(mp,format,ap); -+ vsnprintf(mp,len,format,ap); - #else - # ifdef PYRAMID -- (void)sprintf(mp,format, arg1, arg2, arg3, arg4, arg5, arg6); -+ (void)snprintf(mp,len,format, arg1, arg2, arg3, arg4, arg5, arg6); - # else -- (void)sprintf(mp,format,((int *)ap)[0],((int *)ap)[1],((int *)ap)[2], -+ (void)snprintf(mp,len,format,((int *)ap)[0],((int *)ap)[1],((int *)ap)[2], - ((int *)ap)[3],((int *)ap)[4]); - # endif - #endif -@@ -87,7 +90,8 @@ - (p->user ? p->user : "(null)"), p->client, message); - - /* Append the <CR><LF> */ -- (void)strcat(message, "\r\n"); -+ len -= strlen(message); -+ (void)strncat(message, "\r\n", len); - - /* Send the message to the client */ - (void)fputs(message,p->output); + diff --git a/mail/popper/files/patch-ah b/mail/popper/files/patch-ah new file mode 100644 index 0000000..4d839c7 --- /dev/null +++ b/mail/popper/files/patch-ah @@ -0,0 +1,60 @@ +*** pop_msg.c.orig Thu Nov 20 00:20:38 1997 +--- pop_msg.c Sun Jun 28 21:39:56 1998 +*************** +*** 27,32 **** +--- 27,33 ---- + { + POP * p; + int stat; /* POP status indicator */ ++ int l, len; /* remaining buffer length */ + char * format; /* Format string for the message */ + va_list ap; + register char * mp; +*************** +*** 50,55 **** +--- 51,57 ---- + + /* Point to the message buffer */ + mp = message; ++ len = sizeof(message); + + /* Format the POP status code at the beginning of the message */ + if (stat == POP_SUCCESS) +*************** +*** 58,74 **** + (void)sprintf (mp,"%s ",POP_ERR); + + /* Point past the POP status indicator in the message message */ +! mp += strlen(mp); + + /* Append the message (formatted, if necessary) */ + if (format) + #ifdef HAVE_VPRINTF +! vsprintf(mp,format,ap); + #else + # ifdef PYRAMID +! (void)sprintf(mp,format, arg1, arg2, arg3, arg4, arg5, arg6); + # else +! (void)sprintf(mp,format,((int *)ap)[0],((int *)ap)[1],((int *)ap)[2], + ((int *)ap)[3],((int *)ap)[4]); + # endif + #endif +--- 60,77 ---- + (void)sprintf (mp,"%s ",POP_ERR); + + /* Point past the POP status indicator in the message message */ +! l = strlen(mp); +! len -= l, mp += l; + + /* Append the message (formatted, if necessary) */ + if (format) + #ifdef HAVE_VPRINTF +! vsnprintf(mp,len-3,format,ap); + #else + # ifdef PYRAMID +! (void)snprintf(mp,len-3,format, arg1, arg2, arg3, arg4, arg5, arg6); + # else +! (void)snprintf(mp,len-3,format,((int *)ap)[0],((int *)ap)[1],((int *)ap)[2], + ((int *)ap)[3],((int *)ap)[4]); + # endif + #endif |