Fixed a crash here for NULL ofrom.

2001-10-12  Christopher James Lahey  <clahey@ximian.com>

	* gal/util/e-iconv.c (e_iconv_open): Fixed a crash here for NULL
	ofrom.

svn path=/trunk/; revision=13622
This commit is contained in:
Christopher James Lahey
2001-10-12 15:54:04 +00:00
committed by Chris Lahey
parent 8c65b37a09
commit 2025fe2753

View File

@ -319,6 +319,10 @@ iconv_t e_iconv_open(const char *oto, const char *ofrom)
to = e_iconv_charset_name(oto);
from = e_iconv_charset_name(ofrom);
if (to == NULL)
to = "";
if (from == NULL)
from = "";
tofrom = alloca(strlen(to) +strlen(from) + 2);
sprintf(tofrom, "%s%%%s", to, from);