patch for charset issue

From: Fumihiro Kato <fumi_at_w3.org_at_hypermail-project.org>
Date: Wed, 23 Jan 2008 19:02:12 +0900
Message-ID: <479710A4.9000007_at_w3.org>


Hello,

parse.c has a char array bug. Sometimes it causes a charset problem when Content-Type is us-ascii but message headers include other encoded text like utf-8.

I tried to check out the latest source code from CVS to make patch for CVS, however, the CVS server seemed not to work now. So I made a patch for the bug using a local copy which might be old.



Fumihiro Kato <fumi_at_w3.org>
W3C Systems Team / Keio University

 #ifdef HAVE_ICONV

 	      char *orig2,*output2,*output3;
-	      size_t len;
+	      size_t len, charsetlen;
 	      orig2=output2=malloc(strlen(string)+1);
 	      memset(output2,0,strlen(string)+1);
 	      old_output=output;

_at_@ -891,7 +891,9 @@
memcpy(output,output3,len); output += len; free(output3); - memcpy(charsetsave,charset,strlen(charset)<255 ? strlen(charset) : 255); + charsetlen = strlen(charset) < 255 ? strlen(charset) : 255; + memcpy(charsetsave,charset,charsetlen); + charsetsave[charsetlen] = '\0'; #else for (; *ptr; ptr++) { switch (*ptr) {
Received on Wed 23 Jan 2008 11:28:05 PM GMT

This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:13 AM GMT GMT