After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 712749 - g-c-c network panel crashes in g_markup_escape_text()
g-c-c network panel crashes in g_markup_escape_text()
Status: RESOLVED OBSOLETE
Product: gnome-control-center
Classification: Core
Component: Network
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-20 15:48 UTC by Mathieu Trudel-Lapierre
Modified: 2018-01-23 15:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
make the SSID conversion to a string properly output utf8 (3.18 KB, patch)
2013-11-20 15:48 UTC, Mathieu Trudel-Lapierre
needs-work Details | Review
patch for 3.6.3 (3.80 KB, patch)
2013-11-21 14:53 UTC, Mathieu Trudel-Lapierre
needs-work Details | Review

Description Mathieu Trudel-Lapierre 2013-11-20 15:48:42 UTC
Created attachment 260331 [details] [review]
make the SSID conversion to a string properly output utf8

From downstream bug: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1198315

Seems like gnome-control-center is using, for the network panel, the nm_utils_escape_ssid() function which is really only meant for debugging purposes according to the API documentation, and not guaranteed to return a valid UTF-8 string. It would be better to use nm_utils_ssid_to_utf8() instead (that's already used in other parts of the network panel).

The attached patch seems to fix the issue for me in 3.6.3.

Part of the stacktrace:

 append_escaped_text (length=<optimized out>, text=<optimized out>, str=0x7f9816ba8f80) at /build/buildd/glib2.0-2.37.3/./glib/gmarkup.c:2148
 g_markup_escape_text (text=text@entry=0x7f97df57dec0 <escaped.16720> "B\374ro", length=<optimized out>, length@entry=-1) at /build/buildd/glib2.0-2.37.3/./glib/gmarkup.c:2224
 add_saved_connection (nm_device=<optimized out>, connection=0x7f9800003f00, device_wifi=0x7f9816df66d0) at net-device-wifi.c:535
 device_wifi_refresh_saved_connections (device_wifi=device_wifi@entry=0x7f9816df66d0) at net-device-wifi.c:582
 remote_settings_read_cb (remote_settings=<optimized out>, device_wifi=0x7f9816df66d0) at net-device-wifi.c:1787
Comment 1 Bastien Nocera 2013-11-21 07:20:23 UTC
Review of attachment 260331 [details] [review]:

Not all the cases where you're replacing nm_utils_escape_ssid() should be using nm_utils_ssid_to_utf8().
Comparisons between SSIDs shouldn't use nm_utils_ssid_to_utf8(), only debug messages or other user-visible strings should.

And, 3.6? I'd be more interested in a patch to master.

::: panels/network/net-device-wifi.c
@@ +1126,3 @@
         }
 
+        g_free (ssid_tmp);

g_free() on a const?
Comment 2 Mathieu Trudel-Lapierre 2013-11-21 14:53:22 UTC
Indeed, they probably should not, but you're comparing against the title which is a user-visible string...

Nice catch re. const, I hadn't noticed.

I'll get you an updated patch for master asap.
Comment 3 Mathieu Trudel-Lapierre 2013-11-21 14:53:59 UTC
Created attachment 260451 [details] [review]
patch for 3.6.3
Comment 4 Georges Basile Stavracas Neto 2018-01-23 00:39:08 UTC
Review of attachment 260451 [details] [review]:

Hi Mathieu, thanks for your patch and sorry for the delay. This patch does not apply anymore, would you please rebase it against master?
Comment 5 Mathieu Trudel-Lapierre 2018-01-23 15:20:20 UTC
As far as I can tell, this is no longer an issue. The patch does not apply because there is no longer a use of an SSID retrieved from NM directly without going by nm_utils_ssid_to_utf8() before displaying in the UI.