After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 337741 - Misc fixes after running flowfinder against libgtk-java
Misc fixes after running flowfinder against libgtk-java
Status: RESOLVED FIXED
Product: java-gnome
Classification: Bindings
Component: GTK
mainline
Other All
: Normal normal
: ---
Assigned To: Bodo-Merle Sandor
java-gnome bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-08 20:45 UTC by Bodo-Merle Sandor
Modified: 2006-09-16 20:24 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Misc fixes (9.10 KB, patch)
2006-04-08 20:51 UTC, Bodo-Merle Sandor
none Details | Review

Description Bodo-Merle Sandor 2006-04-08 20:45:35 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.
Comment 1 Bodo-Merle Sandor 2006-04-08 20:51:52 UTC
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
Comment 2 Andrew Cowie 2006-09-15 09:32:34 UTC
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
Comment 3 Bodo-Merle Sandor 2006-09-16 20:24:29 UTC
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