GNOME Bugzilla – Bug 549275
GPattern does not work with non-NUL terminated strings
Last modified: 2018-05-24 11:31:54 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:
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.
-- 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.