This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

iconv dumps core on empty charmap



iconv dumps core when trying to use an empty charmap file. Example:

/usr/bin/iconv -f /packages/glibc-20020408/localedata/charmaps/EMPTY -t /packages/glibc-20020408/localedata/charmaps/UTF-8 /packages/glibc-20020408/iconvdata/testdata/IBM856 > /dev/null
Segmentation fault (core dumped)

Here is a fix.


2002-04-14  Bruno Haible  <bruno@clisp.org>

	* locale/programs/charmap.c (charmap_read): Don't access result if
	result == NULL.

--- glibc-20020408/locale/programs/charmap.c.bak	2002-04-04 20:11:23.000000000 +0200
+++ glibc-20020408/locale/programs/charmap.c	2002-04-15 00:01:03.000000000 +0200
@@ -194,7 +194,7 @@
 default character map file `%s' not found"), DEFAULT_CHARMAP));
     }
 
-  if (result->code_set_name == NULL)
+  if (result != NULL && result->code_set_name == NULL)
     /* The input file does not specify a code set name.  This
        shouldn't happen but we should cope with it.  */
     result->code_set_name = basename (filename);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]