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

git pushed a commit to reference refs/pull/146/head
in repository enlightenment.

View the commit online.

commit 14d2efb54cb93ccc0a24cbf5df8917c055dd6d7a
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Aug 8 18:42:34 2026 -0600

    e_comp_wl - do not walk into strcmp(NULL) when a second output appears
    
    _e_comp_wl_output_get() compares output ids with strcmp() and neither side
    is guaranteed non-NULL. wl_wl and wl_buffer both create their output by
    calling e_comp_wl_output_init() with a NULL id, so that output sits in the
    list with output->id == NULL.
    
    The first call cannot crash - the list is still empty, so the loop body
    never runs. The *second* call walks the list, hits strcmp(NULL, id) and
    takes the compositor down with a SIGSEGV. Nothing today adds a second
    output on those backends, which is why this has gone unnoticed; it fell
    out the moment a test asked for one.
    
    eina_streq() handles NULL on either side and is what the equivalent lookup
    in e_zone_for_id_get() already uses.
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
    Claude-Session: https://claude.ai/code/session_01FtoiXoSKUmZb6Aix6U3GZS
---
 src/bin/e_comp_wl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index acd04fdb8..5fe7176c1 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -3244,7 +3244,11 @@ _e_comp_wl_output_get(Eina_List *outputs, const char *id)
 
    EINA_LIST_FOREACH(outputs, l, output)
      {
-       if (!strcmp(output->id, id))
+       /* eina_streq, not strcmp: wl_wl and wl_buffer both create their output
+        * with a NULL id, so as soon as a second output is added this walks
+        * into strcmp(NULL, ...) and takes the compositor down. Harmless while
+        * there is only ever one output, which is why it has gone unnoticed. */
+       if (eina_streq(output->id, id))
          return output;
      }
 

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

Reply via email to