Commit c178f079 authored by Slava Monich's avatar Slava Monich

[connman] Handle SSIDs that are not valid UTF-8. Fixes JB#38032

When forming the network name from SSID, we need to make sure
that we produce a valid UTF-8 string.
parent 31a55ed7
......@@ -421,8 +421,8 @@ AM_CONDITIONAL(SAILFISH_WIFI, test "${enable_sailfish_wifi}" != "no")
if (test "${enable_sailfish_wifi}" = "yes"); then
PKG_CHECK_MODULES(LIBMCE, libmce-glib, dummy=yes,
AC_MSG_ERROR(libmce-glib is required))
PKG_CHECK_MODULES(GSUPPLICANT, libgsupplicant, dummy=yes,
AC_MSG_ERROR(libgsupplicant is required))
PKG_CHECK_MODULES(GSUPPLICANT, libgsupplicant >= 1.0.4, dummy=yes,
AC_MSG_ERROR(libgsupplicant >= 1.0.4 is required))
CFLAGS="$CFLAGS $GSUPPLICANT_CFLAGS $LIBMCE_CFLAGS"
LIBS="$LIBS $GSUPPLICANT_LIBS $LIBMCE_LIBS"
need_glibutil=yes
......
......@@ -28,6 +28,7 @@
#include <gsupplicant_error.h>
#include <gsupplicant_interface.h>
#include <gsupplicant_network.h>
#include <gsupplicant_util.h>
#include <mce_display.h>
#include <mce_tklock.h>
......@@ -1375,9 +1376,7 @@ static void wifi_network_init(struct wifi_network *net, struct wifi_bss *data)
}
if (ssid && !network_name) {
gsize len = 0;
const void *data = g_bytes_get_data(ssid, &len);
network_name = tmp = g_strndup(data, len);
network_name = tmp = gsupplicant_utf8_from_bytes(ssid);
}
net->network = connman_network_create(net->ident,
......
......@@ -17,6 +17,7 @@ Requires: systemd
Requires: libgofono >= 2.0.0
Requires: libglibutil >= 1.0.21
Requires: libdbusaccess >= 1.0.1
Requires: libgsupplicant >= 1.0.4
Requires(preun): systemd
Requires(post): systemd
Requires(postun): systemd
......@@ -36,7 +37,7 @@ BuildRequires: pkgconfig(libglibutil) >= 1.0.21
BuildRequires: pkgconfig(libdbuslogserver-dbus)
BuildRequires: pkgconfig(libdbusaccess)
BuildRequires: pkgconfig(libmce-glib)
BuildRequires: pkgconfig(libgsupplicant)
BuildRequires: pkgconfig(libgsupplicant) >= 1.0.4
BuildRequires: ppp-devel
%description
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment