libnm: handle illegal characters in nm_utils_ssid_to_utf8() (rh #1243078)
authorDavid Shea <dshea@redhat.com>
Tue, 14 Jul 2015 19:25:52 +0000 (15:25 -0400)
committerJiří Klimeš <jklimes@redhat.com>
Thu, 16 Jul 2015 12:22:03 +0000 (14:22 +0200)
commit568b4ad31f36690091a03cbff0fc7c3a9556e028
tree7b5485bf90be82b97a235451c9f292fd754840f6
parent7b6299d8dd969c10ee0b5ec203d812cf9a6c7a56
libnm: handle illegal characters in nm_utils_ssid_to_utf8() (rh #1243078)

g_convert_with_fallback() will fail if the SSID contains characters that
are not legal in the source encoding, which, if $LANG is not set, will
be ASCII. If this happens, replace all non-ASCII and non-printable
characters with '?'. It is possible that nm_utils_ssid_to_utf8() will
now return an empty string (e.g., the source string is actually
big-endian UTF-16 and g_strcanon() stops on the first byte), but it will
not return NULL.

https://bugzilla.redhat.com/show_bug.cgi?id=1243078
libnm-core/nm-utils.c
libnm-util/nm-utils.c