On Sat, Jun 25, 2022 at 01:50:17AM +0000, Augusto Castelo wrote:
> Hi,
> 
> lsw crashes with a segfault when you pass a window id of a window with no 
> children.
> 
> I spotted the problem, at line 39 of lsw.c; XQueryTree isn't failing but is 
> setting `n` (children count (unsigned int)) to 0, later on `n` is used to 
> loop throgh the children, in the first iteration &wins[n-1] >= &wins[0] is 
> true when `n` is equal to 0 (because n-1 will evaluate to UINT_MAX) and then 
> calling XGetWindowAttributes on that address produces a segfault.
> 
> lsw-version: 0.3
> lsw-commit-hash: 4d6e1b3
> 
> Cheers!
> 

Hi Augusto,

Thanks reporting it. I pushed a fix to the repo. Let me know if it doesn't work
for you.

I also pushed a few code-style and cleanup improvements.

Thanks,

-- 
Kind regards,
Hiltjo

Reply via email to