Subject: pkg/23917: mail/sylpheed-gtk2 truncates non-ascii headers
To: None <>
From: Min Sik Kim <>
List: netbsd-bugs
Date: 12/28/2003 10:21:31
>Number:         23917
>Category:       pkg
>Synopsis:       mail/sylpheed-gtk2 truncates non-ascii headers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 28 16:22:00 UTC 2003
>Originator:     Min Sik Kim
>Release:        NetBSD 1.6ZG
sylpheed-gtk calls isspace(3) with signed char in src/codeconv.c.
Since the behavior of isspace(3) is undefiend when its argument is
negative, it may return an unexpected result for non-ascii characters.
In fact, it returns a non-zero value for many Korean characters,
resulting in truncated headers.  I suspect mail/sylpheed and
mail/sylpheed-claws have the same problem.

I reported this problem to the sylpheed mailing list, but didn't get
any reply yet.


Add the following patch and regen distinfo.


--- src/codeconv.c.orig	2003-09-06 01:19:31.000000000 -0500
+++ src/codeconv.c
@@ -1475,7 +1475,7 @@ void conv_encode_header(gchar *dest, gin
 	gint mimestr_len;
 	gchar *mimesep_enc;
 	gint left;
-	const gchar *srcp = src;
+	const guchar *srcp = src;
 	gchar *destp = dest;
 	gboolean use_base64;
@@ -1537,7 +1537,7 @@ void conv_encode_header(gchar *dest, gin
 			gchar *part_str;
 			gchar *out_str;
 			gchar *enc_str;
-			const gchar *p = srcp;
+			const guchar *p = srcp;
 			gint out_str_len;
 			gint out_enc_str_len;
 			gint mime_block_len;
 System: NetBSD 1.6ZG NetBSD 1.6ZG (SULLEY) #1: Tue Dec 16 01:53:13 CST 2003 i386
 Architecture: i386
 Machine: i386