GNOME Bugzilla – Bug 476840
Invocation of the interface "g_utf8_strreverse" crashes for certain input values
Last modified: 2007-09-14 13:31:58 UTC
Steps to reproduce:
1. Invocation of the interface g_utf8_strreverse with 0<len<sizeof(str)-1 results in corruption of memory, due to incorrect while() loop condition.
2. Sample program
gchar str = "Internet";
gchar* retValue = g_utf8_strreverse(str,5);
The detailed bug description can be found at:
Created attachment 95581 [details] [review]
Proposed patch, fixing the problem
(In reply to comment #1)
> Created an attachment (id=95581) 
> Proposed patch, fixing the problem
thanks, please use diff -up next time and try to match the coding style (spaces around operators. fixed with a similar patch now:
2007-09-14 15:07:28 Tim Janik <firstname.lastname@example.org>
* glib/gutf8.c (g_utf8_strreverse): applied fix for bug #476840.
* tests/utf8-pointer.c (test_misc): added test for g_utf8_strreverse().