+2004-04-15 Matthias Clasen <mclasen@redhat.com>
+
+ * tests/patterntest.c (main): Add tests for the empty pattern.
+
+ * glib/gpattern.c (g_pattern_spec_new): Don't read and write out
+ of bounds when the pattern is empty. (#140032, Stanislav Brabec,
+ Stefan Fent)
+
2004-04-10 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_getlocale): Add new language and
+2004-04-15 Matthias Clasen <mclasen@redhat.com>
+
+ * tests/patterntest.c (main): Add tests for the empty pattern.
+
+ * glib/gpattern.c (g_pattern_spec_new): Don't read and write out
+ of bounds when the pattern is empty. (#140032, Stanislav Brabec,
+ Stefan Fent)
+
2004-04-10 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_getlocale): Add new language and
+2004-04-15 Matthias Clasen <mclasen@redhat.com>
+
+ * tests/patterntest.c (main): Add tests for the empty pattern.
+
+ * glib/gpattern.c (g_pattern_spec_new): Don't read and write out
+ of bounds when the pattern is empty. (#140032, Stanislav Brabec,
+ Stefan Fent)
+
2004-04-10 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_getlocale): Add new language and
+2004-04-15 Matthias Clasen <mclasen@redhat.com>
+
+ * tests/patterntest.c (main): Add tests for the empty pattern.
+
+ * glib/gpattern.c (g_pattern_spec_new): Don't read and write out
+ of bounds when the pattern is empty. (#140032, Stanislav Brabec,
+ Stefan Fent)
+
2004-04-10 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_getlocale): Add new language and
+2004-04-15 Matthias Clasen <mclasen@redhat.com>
+
+ * tests/patterntest.c (main): Add tests for the empty pattern.
+
+ * glib/gpattern.c (g_pattern_spec_new): Don't read and write out
+ of bounds when the pattern is empty. (#140032, Stanislav Brabec,
+ Stefan Fent)
+
2004-04-10 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_getlocale): Add new language and
+2004-04-15 Matthias Clasen <mclasen@redhat.com>
+
+ * tests/patterntest.c (main): Add tests for the empty pattern.
+
+ * glib/gpattern.c (g_pattern_spec_new): Don't read and write out
+ of bounds when the pattern is empty. (#140032, Stanislav Brabec,
+ Stefan Fent)
+
2004-04-10 Tor Lillqvist <tml@iki.fi>
* glib/gwin32.c (g_win32_getlocale): Add new language and
pspec->pattern[pspec->pattern_length] = 0;
return pspec;
}
- if (pspec->pattern[pspec->pattern_length - 1] == '*')
+ if (pspec->pattern_length > 0 &&
+ pspec->pattern[pspec->pattern_length - 1] == '*')
{
pspec->match_type = G_MATCH_HEAD;
pspec->pattern[--pspec->pattern_length] = 0;
TEST_MATCH("ab*", "ab\xc3\xa4\xc3\xb6", TRUE);
TEST_MATCH("ab*\xc3\xb6", "ab\xc3\xa4\xc3\xb6", TRUE);
TEST_MATCH("ab*\xc3\xb6", "aba\xc3\xb6x\xc3\xb6", TRUE);
+ TEST_MATCH("", "", TRUE);
+ TEST_MATCH("", "abc", FALSE);
verbose ("\n%u tests passed, %u failed\n", passed, failed);