To: vim_dev@googlegroups.com Subject: Patch 9.0.0339 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0339 Problem: No check if the return value of XChangeGC() is NULL. Solution: Only use the return value when it is not NULL. (closes #11020) Files: src/gui_x11.c *** ../vim-9.0.0338/src/gui_x11.c 2022-04-03 17:20:59.000000000 +0100 --- src/gui_x11.c 2022-08-31 10:56:24.748281429 +0100 *************** *** 2231,2240 **** { Pixmap blank_pixmap = XCreatePixmap(gui.dpy, gui.wid, 1, 1, 1); GC gc = XCreateGC(gui.dpy, blank_pixmap, (unsigned long)0, (XGCValues*)0); ! XDrawPoint(gui.dpy, blank_pixmap, gc, 0, 0); ! XFreeGC(gui.dpy, gc); return XCreatePixmapCursor(gui.dpy, blank_pixmap, blank_pixmap, ! (XColor*)&gui.norm_pixel, (XColor*)&gui.norm_pixel, 0, 0); } /* --- 2231,2244 ---- { Pixmap blank_pixmap = XCreatePixmap(gui.dpy, gui.wid, 1, 1, 1); GC gc = XCreateGC(gui.dpy, blank_pixmap, (unsigned long)0, (XGCValues*)0); ! ! if (gc != NULL) ! { ! XDrawPoint(gui.dpy, blank_pixmap, gc, 0, 0); ! XFreeGC(gui.dpy, gc); ! } return XCreatePixmapCursor(gui.dpy, blank_pixmap, blank_pixmap, ! (XColor*)&gui.norm_pixel, (XColor*)&gui.norm_pixel, 0, 0); } /* *** ../vim-9.0.0338/src/version.c 2022-08-31 11:25:02.819996932 +0100 --- src/version.c 2022-08-31 12:00:41.345427581 +0100 *************** *** 709,710 **** --- 709,712 ---- { /* Add new patch number below this line */ + /**/ + 339, /**/ -- If all you have is a hammer, everything looks like a nail. When your hammer is C++, everything begins to look like a thumb. -- Steve Hoflich, comp.lang.c++ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///