resurrecting-open-source-projects / scrot

SCReenshOT - command line screen capture utility
Other
511 stars 51 forks source link

fix: buffer overrun due to bad x,y #364

Closed N-R-K closed 1 year ago

N-R-K commented 1 year ago

imlib_create_image_from_ximage() expects x and y relative to the image itself and has no relation with the x,y position of the window.

which means we should pass 0 in both of them. otherwise, it'll try to read a width and height that's bigger than the image actually has.

buffer overflow was caught via AddressSanitizer.