resurrecting-open-source-projects / scrot

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

XChangeProperty() errors aren't checked #300

Closed guijan closed 1 year ago

guijan commented 1 year ago

The Xlib XChangeProperty(3) man page says:

XChangeProperty can generate BadAlloc, BadAtom, BadMatch, BadValue, and BadWindow errors.

https://github.com/resurrecting-open-source-projects/scrot/blob/6e2b5221bc25bb073552a2b0707ee99803f1a44f/src/selection_edge.c#L81-L89 Seems there's some missing error checking there, probably other places too.

edit: XInternAtom() in those same lines can error too.

guijan commented 1 year ago

ah, silly me, I forgot the default XSetErrorHandler()