]> granicus.if.org Git - neomutt/commitdiff
[patch-0.94.4i.tlr.shell_quote.1-2] Fix a brain-dead
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 27 Aug 1998 17:24:21 +0000 (17:24 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 27 Aug 1998 17:24:21 +0000 (17:24 +0000)
segmentation fault when freeing non-allocated memory.

rfc1524.c
testmsg [deleted file]

index 04ac24cd69265a47f810c06a54c680645b3907f7..88eeae65450a7d70575a303b0af57e4ae75cda81 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
@@ -84,9 +84,10 @@ int rfc1524_expand_command (BODY *a, char *filename, char *type,
       else if (command[x] == 's' && filename != NULL)
       {
        char *fn = mutt_quote_filename(filename);
-
-       while (*fn && y < sizeof (buf))
-         buf[y++] = *fn++;
+       int i;
+       
+       for(i = 0; fn[i] && y < sizeof(buf); i++)
+         buf[y++] = fn[i];
        
        FREE(&fn);
        needspipe = FALSE;
diff --git a/testmsg b/testmsg
deleted file mode 100644 (file)
index 87ec8f6..0000000
--- a/testmsg
+++ /dev/null
@@ -1,45 +0,0 @@
-From michael Thu Apr  2 17:51:50 PST 1998
-From: michael
-To: michael
-Subject: complex multipart
-Mime-Version: 1.0
-Content-Type: multipart/mixed; boundary=foo
-
---foo
-Content-Type text/plain
-
-This is part one.
-
---foo
-Content-Type text/plain
-
-This is part two.
-
---foo
-Content-Type text/plain
-
-This is part three.
-
---foo
-Content-Type: message/rfc822
-
-From: bob
-To: joe
-Subject: nested message
-Mime-Version: 1.0
-Content-Type: multipart/mixed; boundary=bar
-
---bar
-Content-Type text/plain
-
-This is subpart one.
-
---bar
-Content-Type text/plain
-
-This is subpart two.
-
---bar--
-
---foo--
-