#1136896 screen: uninitialized use of pollfd structs

Package:
screen
Source:
screen
Description:
terminal multiplexer with VT100/ANSI terminal emulation
Submitter:
Daniel Serpell
Date:
2026-05-20 19:57:01 UTC
Severity:
normal
Tags:
#1136896#5
Date:
2026-05-17 04:12:48 UTC
From:
To:
Dear maintainer,

Running screen on valgrind to resolve another bug, I discovered that
the pollfd sctructs were not initialized.

The attached patch fixes this and silences valgrind.

Regards,

#1136896#10
Date:
2026-05-20 19:54:35 UTC
From:
To:
Hi Daniel,

Thanks for the investigation and the patch.

I won't proclaim to be a C memory expert, and I'm not comfortable
applying this patch as-is without being reviewed by a more experienced
dev.

I agree with the uninitialised pollfd concern you identified.  However,
based on my read of the docs, I am concerned that if realloc returns
NULL, then the next memset statement is "undefined" (i.e. probably a
segfault).

Could I ask that you raise this directly upstream?
https://savannah.gnu.org/bugs/?group=screen&func=additem

Thanks again for digging into this.

Cheers,
Peter Dey