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 743233 - 0.20.3: fix two GLib-CRITICAL warnings on strange input
0.20.3: fix two GLib-CRITICAL warnings on strange input
Status: RESOLVED OBSOLETE
Product: GUPnP
Classification: Other
Component: gupnp
0.20.x
Other All
: Normal minor
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-20 10:10 UTC by Thomas Klausner
Modified: 2021-05-17 16:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch fixing the problem. (463 bytes, patch)
2015-01-20 10:10 UTC, Thomas Klausner
none Details | Review
Ok, this seems to work and is abusing things just a little bit... (1.55 KB, patch)
2015-01-24 12:32 UTC, Jens Georg
none Details | Review
Add test for bgo#743233 (1.75 KB, patch)
2015-01-24 12:47 UTC, Jens Georg
none Details | Review

Description Thomas Klausner 2015-01-20 10:10:27 UTC
Created attachment 294964 [details] [review]
Patch fixing the problem.

libgupnp/gupnp-control-point's parse_usn function prints two GLib-CRITICAL warnings on weird input. The attached patch fixes these.

The issue is that the second part of the string could be the empty string "" and g_strsplit reports an assertion failure string != NULL, and then g_strv_length reports a second assertion for str_array != NULL.

The attached patch fixes this.
Comment 1 Jens Georg 2015-01-20 15:53:23 UTC
If you could also provide a test for that that would be awsome :)
Comment 2 Thomas Klausner 2015-01-23 17:23:39 UTC
I think that

parse_usn("uuid:someuuid::", &foo, &bar);

should trigger this. I'm not sure how to best make that into a test though.
Comment 3 Jens Georg 2015-01-24 12:19:19 UTC
Mhm. True, that's a bit ugly to write a test for :-/
Comment 4 Jens Georg 2015-01-24 12:32:19 UTC
Created attachment 295319 [details] [review]
Ok, this seems to work and is abusing things just a little bit...

Add test for bgo#743233

Signed-off-by: Jens Georg <mail@jensge.org>
Comment 5 Jens Georg 2015-01-24 12:47:49 UTC
Created attachment 295321 [details] [review]
Add test for bgo#743233

Signed-off-by: Jens Georg <mail@jensge.org>
Comment 6 Jens Georg 2015-01-24 12:52:38 UTC
parse_usn("uuid:someuuid::", &foo, &bar); does not seem to trigger any criticals...
Comment 7 Thomas Klausner 2015-02-02 12:01:25 UTC
I still can't test the patch (see #743462), but from reading the patch I think it does not test what it claims to test -- gupnp_control_point_new is not called with TEST_BGO_743233_USN, but a different string.
Comment 8 Jens Georg 2015-02-02 13:48:54 UTC
That doesn't matter, the code and the data triggering the call of the parse_usn function is this:

g_signal_emit_by_name (cp, "resource-unavailable", TEST_BGO_743233_USN);

Though that should probably be documented. The idea was to use a UUID for the control point that cannot be triggered otherwise.
Comment 9 GNOME Infrastructure Team 2021-05-17 16:30:26 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gupnp/-/issues/41.