From 5b5d33c642878fbfdc543a197cbc05fa6001fd13 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Tue, 27 Jan 2009 00:07:50 +0100 Subject: [PATCH] check if s and locale_charset ptrs are NULL before conversion --- src/charset.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charset.cpp b/src/charset.cpp index aed3e806..56b887f5 100644 --- a/src/charset.cpp +++ b/src/charset.cpp @@ -166,14 +166,14 @@ std::string locale_to_utf_cpy(const std::string &s) void str_pool_utf_to_locale(char *&s) { - if (!has_non_ascii_chars(s)) + if (!s || !locale_charset || !has_non_ascii_chars(s)) return; charset_convert("utf8", locale_charset, s); } void str_pool_locale_to_utf(char *&s) { - if (!has_non_ascii_chars(s)) + if (!s || !locale_charset || !has_non_ascii_chars(s)) return; charset_convert(locale_charset, "utf8", s); }