openbsd-ports/mail/pine/patches/patch-pine_mailcap_c

27 lines
929 B
Plaintext

$OpenBSD: patch-pine_mailcap_c,v 1.3 2003/10/05 21:42:29 jakob Exp $
--- pine/mailcap.c.orig Tue Sep 2 19:57:34 2003
+++ pine/mailcap.c Sat Sep 20 00:08:13 2003
@@ -933,14 +933,18 @@ mc_cmd_bldr(controlstring, type, subtype
* have to put those outside of the single quotes.
* (The parm+1000 nonsense is to protect against
* malicious mail trying to overlow our buffer.)
+ *
+ * TCH - Change 2/8/1999
+ * Also quote the ` slash to prevent execution of arbitrary code
*/
for(p = parm; *p && p < parm+1000; p++){
- if(*p == '\''){
+ if((*p == '\'') || (*p=='`')) {
*to++ = '\''; /* closing quote */
*to++ = '\\';
- *to++ = '\''; /* below will be opening quote */
- }
- *to++ = *p;
+ *to++ = *p; /* quoted character */
+ *to++ = '\''; /* opening quote */
+ } else
+ *to++ = *p;
}
fs_give((void **) &parm);