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 549275 - GPattern does not work with non-NUL terminated strings
GPattern does not work with non-NUL terminated strings
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: general
2.16.x
Other All
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-08-25 09:38 UTC by Balazs Scheidler
Modified: 2018-05-24 11:31 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Patch to actually support string_length != strlen(string) (10.46 KB, patch)
2013-10-12 14:46 UTC, Ihar Hrachyshka
none Details | Review

Description Balazs Scheidler 2008-08-25 09:38:16 UTC
Please describe the problem:

Although g_pattern_match() expects a string-length to be passed, it does not
in reality work with strings that are not zero terminated.

This is not stated in the documentation, but in any case, it is a useful feature to match substrings of a larger strings without having to copy that given substring just for zero termination.



Steps to reproduce:
1. always, just pass a non-zero terminated string to g_pattern_match


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Ihar Hrachyshka 2013-10-12 14:46:10 UTC
Created attachment 257104 [details] [review]
Patch to actually support string_length != strlen(string)

This patch allows to match against non-NULL terminated strings by honoring string_length argument. Also several incorrect accesses to Unicode data are fixed.
Comment 2 GNOME Infrastructure Team 2018-05-24 11:31:54 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/158.