This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
iconv dumps core on empty charmap
- From: Bruno Haible <bruno at clisp dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Mon, 15 Apr 2002 14:16:27 +0200 (CEST)
- Subject: 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);