[PATCH] Fix write to uninitialized bytes for XCB event

Pavel Sanda sanda at lyx.org
Wed Feb 19 07:42:57 UTC 2020


On Wed, Feb 19, 2020 at 08:24:43AM +0100, Enrico Forestieri wrote:
> On Tue, Feb 18, 2020 at 09:49:08PM -0500, Scott Kostyshak wrote:
> > 
> > Attached is a patch. I really don't know what I'm doing. The use of
> > calloc scares me. I just used the xcb_send_event man page and
> > experimented until compilation and valgrind did not complain.
> > 
> > Could anyone take a close look at this? If there is a better fix, please
> > go ahead.
> 
> Does simply replacing
> 	xcb_selection_notify_event_t nev;
> with
> 	xcb_selection_notify_event_t nev = {0};
> help?

Did not try, but I am afraid generally it won't, because 
xcb_selection_notify_event_t is not enforced to have 32 bits,
while that's requested by underlying X routines. That's why
the padding by 0s.

Pavel


More information about the lyx-devel mailing list