This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository enventor.

View the commit online.

commit c5e6ca5e99a264be4960292acb0aef642fcaedc7
Author: Thanatermesis <[email protected]>
AuthorDate: Mon Feb 23 15:57:54 2026 -0500

    fix: Correct Evas_Coord type usage and prevent view size buffer overflow
    
    I have identified a potential issue in src/bin/preference_setting.c:
    
    In preference_setting_reset, config_view_size_get is called with pointers to int, but it expects pointers to Evas_Coord. While Evas_Coord is usually an int, it is safer and
    more consistent with the rest of the file (and the function signature in the header) to use Evas_Coord to avoid potential type mismatch issues on certain architectures.
    
    Additionally, in preference_setting_content_get, there's a potential buffer overflow risk. w_str and h_str are size 5, and snprintf is used with sizeof(w_str). However,
    Evas_Coord (effectively int) can represent values up to 5 or more digits (plus sign). While the entry filter limits input to 4 characters later, the initial value from config
    might exceed this. I will increase the buffer size to 10, matching the buffer size used in preference_setting_reset.
---
 src/bin/preference_setting.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/preference_setting.c b/src/bin/preference_setting.c
index 0cb6624..3d1b372 100644
--- a/src/bin/preference_setting.c
+++ b/src/bin/preference_setting.c
@@ -104,7 +104,7 @@ preference_setting_reset(preference_setting_data *psd)
    elm_check_state_set(psd->toggle_red_alert, config_red_alert_get());
 
    //Reset view scale
-   int view_size_w, view_size_h;
+   Evas_Coord view_size_w, view_size_h;
    config_view_size_get(&view_size_w, &view_size_h);
    char buf[10];
    snprintf(buf, sizeof(buf), "%d", view_size_w);
@@ -181,7 +181,7 @@ preference_setting_content_get(preference_setting_data *psd,
    elm_box_pack_end(box2, rect);
 
    Evas_Coord w, h;
-   char w_str[5], h_str[5];
+   char w_str[10], h_str[10];
    config_view_size_get(&w, &h);
    snprintf(w_str, sizeof(w_str), "%d", w);
    snprintf(h_str, sizeof(h_str), "%d", h);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to