summaryrefslogtreecommitdiff
path: root/databases/abook/patches
diff options
context:
space:
mode:
authorkim <kim>2004-07-28 02:50:22 +0000
committerkim <kim>2004-07-28 02:50:22 +0000
commit28d3ec57c7a58c35820df7a2d34d0d4869540174 (patch)
tree6f07b358ea6a9ddf4efdbc93005d445e05f53978 /databases/abook/patches
parent0c55b8fa31dddbfb2a13bcb6be65757fa194c280 (diff)
downloadpkgsrc-28d3ec57c7a58c35820df7a2d34d0d4869540174.tar.gz
Add a patch from abook CVS to fix string truncation in mutt import filter.
Diffstat (limited to 'databases/abook/patches')
-rw-r--r--databases/abook/patches/patch-aa40
1 files changed, 40 insertions, 0 deletions
diff --git a/databases/abook/patches/patch-aa b/databases/abook/patches/patch-aa
new file mode 100644
index 00000000000..9daf8cef3a9
--- /dev/null
+++ b/databases/abook/patches/patch-aa
@@ -0,0 +1,40 @@
+$NetBSD: patch-aa,v 1.1 2004/07/28 02:50:22 kim Exp $
+
+--- filter.c 2004/01/23 07:14:32 1.29
++++ filter.c 2004/03/25 18:19:38 1.30
+@@ -1,6 +1,6 @@
+
+ /*
+- * $Id: patch-aa,v 1.1 2004/07/28 02:50:22 kim Exp $
++ * $Id: patch-aa,v 1.1 2004/07/28 02:50:22 kim Exp $
+ *
+ * by JH <jheinonen@users.sourceforge.net>
+ *
+@@ -618,6 +618,7 @@
+ mutt_read_line(FILE *in, char **alias, char **rest)
+ {
+ char *line, *ptr, *tmp;
++ size_t alias_len;
+
+ if( !(line = ptr = getaline(in)) )
+ return 1; /* error / EOF */
+@@ -640,13 +641,16 @@
+ while( ! ISSPACE(*ptr) )
+ ptr++;
+
+- if( (*alias = (char *)malloc(ptr - tmp)) == NULL) {
++ /* includes also the trailing zero */
++ alias_len = (size_t)(ptr - tmp + 1);
++
++ if( (*alias = (char *)malloc(alias_len)) == NULL) {
+ free(line);
+ return 1;
+ }
+
+- strncpy(*alias, tmp, ptr - tmp - 1);
+- *(*alias + (ptr - tmp - 1)) = 0;
++ strncpy(*alias, tmp, alias_len - 1);
++ *(*alias + alias_len - 1) = 0;
+
+ while(ISSPACE(*ptr))
+ ptr++;