[file-roller] libarchive: don't convert null strings to utf8



commit 78a608ae8d0058fdf202da5b561c1cbdd937ad99
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Feb 18 08:52:54 2017 +0100

    libarchive: don't convert null strings to utf8

 src/fr-archive-libarchive.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c
index 3ac1004..70c07e2 100644
--- a/src/fr-archive-libarchive.c
+++ b/src/fr-archive-libarchive.c
@@ -321,7 +321,7 @@ _g_error_new_from_archive_error (const char *s)
        char   *msg;
        GError *error;
 
-       msg = g_locale_to_utf8 (s, -1, NULL, NULL, NULL);
+       msg = (s != NULL) ? g_locale_to_utf8 (s, -1, NULL, NULL, NULL) : NULL;
        if (msg == NULL)
                msg = g_strdup ("Fatal error");
        error = g_error_new_literal (FR_ERROR, FR_ERROR_COMMAND_ERROR, msg);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]