xclip
xclip copied to clipboard
Do not dereference garbage pointers in sel_buf (doOut)
We've been seeing segfaults in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1947285. An analysis of the bug is available at that URL. Briefly, sel_buf
contains garbage bytes when the while loop is entered, and those bytes can be dereferenced or passed to free()
.
Worth noting that this solution solves the problem described in PR #117 , but in a way that doesn't break the pathing where sel_buf has data that needs to be freed.