GNOME Bugzilla – Bug 337741
Misc fixes after running flowfinder against libgtk-java
Last modified: 2006-09-16 20:24:29 UTC
Please describe the problem: The patch corrects several possibly dangerous jni code. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information: patch follow.
Created attachment 62989 [details] [review] Misc fixes 1. Use const qualifier where we get internal Gtk data back. 2. use g_snprintf instead of sprintf 3. The assumption that gdk_pixbuf_get_pixels returns a valid C string is apparently not valid - replace the size calculation of the Pixbuf 4. Replace a seemingly unnecessary g_malloc with an auto allocated char array. 5. replaced some unchecked malloc's with g_malloc
Sandor, Keep in mind that most of what is in libgtk-java/src/jni/gtk_java.c is moving [has moved?] to glib-java/src/glib_java.c; see bug 350092 - you may need to do this patch there instead. AfC
Applied the fixes to current CVS head with taking care of the code movement. As a side note - it seems that gtk_java.c and glib_java.c (a copy of the former one) will get out of sync very easy, and contains duplicate code. IIRC this was already mentioned but i dont recall a proper solution for it. Sanyi