Re: Debian Bug#308296: mc segfaults on charset encoding change




Roland Illig wrote:
> Sorry, but I cannot find any of the lines from the patch in that archive.

Yes, in fact there's already a patch that's been applied (see attached
file). Maybe we should not have applied this unofficial patch...

The debian changelog entry related to this patch follows:

  * Added Bad error checking after iconv() call patch by Jindrich Novy with
    33_mc-iconv-error.patch

I do not like to add unofficial patches on debian packages, but what should
we do:
- improve 33_mc-iconv-error.patch ?
- or remove it ?

Cheers,

-- 
Ludovic Drolez.

http://www.palmopensource.com       - The PalmOS Open Source Portal
http://www.drolez.com      - Personal site - Linux and PalmOS stuff
--- src/charsets.c.iconv-error	2004-08-30 12:38:00.000000000 +0200
+++ src/charsets.c	2005-02-07 10:31:57.523987520 +0100
@@ -142,17 +142,16 @@ get_codepage_index (const char *id)
 static char
 translate_character (iconv_t cd, char c)
 {
-    char outbuf[4], *obuf;
+    char obuf[4];
     size_t ibuflen, obuflen, count;
 
     ICONV_CONST char *ibuf = &c;
-    obuf = outbuf;
     ibuflen = 1;
-    obuflen = 4;
+    obuflen = sizeof(obuf);
 
-    count = iconv (cd, &ibuf, &ibuflen, &obuf, &obuflen);
-    if (count >= 0 && ibuflen == 0)
-	return outbuf[0];
+    count = iconv (cd, &ibuf, &ibuflen, (char **)&obuf, &obuflen);
+    if (count != (size_t)(-1) && ibuflen == 0)
+	return obuf[0];
 
     return UNKNCHAR;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]