aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/03-w3m-mime-buffer-overflow-fix-backport-from-w3m-dev-02066
blob: 7c47d04f410d9af9b56c59b3e3c149e2353f3f2a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- mimehead.c.orig	Tue Jun  6 14:39:13 2000
+++ mimehead.c	Wed Jun 20 11:21:02 2001
@@ -166,21 +166,20 @@
 Str
 decodeWord(char **ow)
 {
-    char charset[32];
     char *p, *w = *ow;
     char method;
     Str a = Strnew();
+    Str charset = Strnew();
 
     if (*w != '=' || *(w + 1) != '?')
 	goto convert_fail;
     w += 2;
-    for (p = charset; *w != '?'; w++) {
+    for (; *w != '?'; w++) {
 	if (*w == '\0')
 	    goto convert_fail;
-	*(p++) = *w;
+	Strcat_char(charset, *w);
     }
-    *p = '\0';
-    if (strcasecmp(charset, J_CHARSET) != 0) {
+    if (Strcasecmp_charp(charset, J_CHARSET) != 0) {
 	/* NOT ISO-2022-JP encoding ... don't convert */
 	goto convert_fail;
     }