On Tue, 21 Feb 2023 00:29:13 GMT, Thiago Milczarek Sayao <tsa...@openjdk.org> 
wrote:

>> Simple PR to remove gtk2 library compilation and loading.
>
> Thiago Milczarek Sayao has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Improve exception

The updated fix and changes to tests looks fine.

I think the check you added for minimum GTK version of 3.8 is also fine, but I 
noted one thing (the call to sprintf) that needs to be changed.

modules/javafx.graphics/src/main/native-glass/gtk/GlassApplication.cpp line 118:

> 116:     // Major version is checked before loading
> 117:     if (version == 3) {
> 118:         if(gtk_check_version(version, GTK_3_MIN_MINOR_VERSION, 
> GTK_3_MIN_MICRO_VERSION)) {

Minor: add space after `if`

modules/javafx.graphics/src/main/native-glass/gtk/GlassApplication.cpp line 120:

> 118:         if(gtk_check_version(version, GTK_3_MIN_MINOR_VERSION, 
> GTK_3_MIN_MICRO_VERSION)) {
> 119:             char message[100];
> 120:             std::sprintf(message, "Minimum GTK version required is 
> %d.%d.%d. System has %d.%d.%d.",

Please change this to `snprintf`, which take the length of the array. We should 
not be using `sprintf` directly as that can lead to buffer overflow.

-------------

PR: https://git.openjdk.org/jfx/pull/999

Reply via email to