From 929b60ba424e3e54b0fdb4fc28fa160b6bfec82d Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Tue, 23 Dec 2008 05:01:43 +0000 Subject: [PATCH] If conversion from UTF8 fails, don't mark Unicode text as available. Submitted by: Michihiro NAKAJIMA MFC after: 30 days --- lib/libarchive/archive_entry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c index 28054a9b3c6..3e52b186407 100644 --- a/lib/libarchive/archive_entry.c +++ b/lib/libarchive/archive_entry.c @@ -239,7 +239,8 @@ aes_get_wcs(struct aes *aes) if (aes->aes_set & AES_SET_UTF8) { /* Try converting UTF8 to WCS. */ aes->aes_wcs = __archive_string_utf8_w(&(aes->aes_utf8)); - aes->aes_set |= AES_SET_WCS; + if (aes->aes_wcs != NULL) + aes->aes_set |= AES_SET_WCS; return (aes->aes_wcs); } return (NULL);