diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-10-22 09:58:27 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-10-22 09:58:27 +0200 |
commit | 6c8387018b130eb4ef69ea377e9154ba04f0fd50 (patch) | |
tree | d2f8660ea2dea3fdca1aa2d98531ad0559eb4aaa | |
parent | e6d4d3cbb4242d536474f4e8e2262bc5886200db (diff) | |
download | tigervnc-6c8387018b130eb4ef69ea377e9154ba04f0fd50.tar.gz tigervnc-6c8387018b130eb4ef69ea377e9154ba04f0fd50.zip |
Avoid invalid XFree for XClassHint
It seems XGetClassHint() doesn't set the pointers to NULL if there is no
name, so we need to make sure it is cleared beforehand. Otherwise we can
get an invalid pointer given to XFree().
-rw-r--r-- | unix/tx/TXWindow.cxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/unix/tx/TXWindow.cxx b/unix/tx/TXWindow.cxx index b6a29d67..639c1382 100644 --- a/unix/tx/TXWindow.cxx +++ b/unix/tx/TXWindow.cxx @@ -313,6 +313,7 @@ void TXWindow::toplevel(const char* name, TXDeleteWindowCallback* dwc_, void TXWindow::setName(const char* name) { XClassHint classHint; + memset(&classHint, 0, sizeof(classHint)); XGetClassHint(dpy, win(), &classHint); XFree(classHint.res_name); classHint.res_name = (char*)name; |