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 #include <glib-2.0/glib.h> int main() { gchar str[] = "Internet"; gchar* retValue = g_utf8_strreverse(str,5); g_free(retValue); return 0; } Stack trace:
+ Trace 162835
Other information: The detailed bug description can be found at: http://linuxtesting.org/results/report?num=D0022
Created attachment 95581 [details] [review] Proposed patch, fixing the problem
(In reply to comment #1) > Created an attachment (id=95581) [edit] > 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 <timj@gtk.org> * glib/gutf8.c (g_utf8_strreverse): applied fix for bug #476840. * tests/utf8-pointer.c (test_misc): added test for g_utf8_strreverse().