PR# 19969 Potential buffer overflow in EiffelVision GTK binding
Problem Report Summary
Submitter: gobobe
Category: EiffelVision
Priority: Low
Date: 2026/01/05
Class: Bug
Severity: Non-critical
Number: 19969
Release: 25.02.9.8732
Confidential: No
Status: Closed
Responsible:
Environment: win
Synopsis: Potential buffer overflow in EiffelVision GTK binding
Description
When compiling the C code for the GTK binding with gcc, it complains about potential buffer overflow in ev_c_util.c: ```c if ( strlen (log_domain) + strlen (level) > 999 ) sprintf (buf, "%s-%s\n", log_domain, level); else sprintf (buf, "GTK-%s\n", level); ``` The two lines should be inverted, and a "+1" should be added for the hyphen. Here is a reorganization of the nested if-statements: ```c if ( strlen (log_domain) + strlen (level) + strlen (message) + 2 < 1000 ) sprintf (buf, "%s-%s %s", log_domain, level, message); else if ( strlen (log_domain) + strlen (level) + 1 < 1000 ) sprintf (buf, "%s-%s\n", log_domain, level); else sprintf (buf, "GTK-%s\n", level); ``` -- Eric Bezault
To Reproduce