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 736630 - gio/gresource.c:do_lookup check for terminating "/"
gio/gresource.c:do_lookup check for terminating "/"
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-09-13 19:36 UTC by Morten Welinder
Modified: 2018-05-24 17:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2014-09-13 19:36:12 UTC
The code fragment...

  path_len = strlen (path);
  if (path[path_len-1] == '/')
    {
      path = free_path = g_strdup (path);
      free_path[path_len-1] = 0;
    }

...fails to work as intended when path = "".  It could, potentially, write
to memory it does not own.

A check for path_len==0 should be added.
Comment 1 GNOME Infrastructure Team 2018-05-24 17:01:19 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/glib/issues/927.