# HG changeset patch # User Bram Moolenaar # Date 1661944502 -7200 # Node ID 01087b4630daaec959b624c1e7c77243a4ca7bae # Parent b3fd1aacd62af9ac75f2e1a220a55a693b7e626b patch 9.0.0339: no check if the return value of XChangeGC() is NULL Commit: https://github.com/vim/vim/commit/a63ad78ed31e36dbdf3a9cd28071dcdbefce7d19 Author: Bram Moolenaar Date: Wed Aug 31 12:01:54 2022 +0100 patch 9.0.0339: no check if the return value of XChangeGC() is NULL Problem: No check if the return value of XChangeGC() is NULL. Solution: Only use the return value when it is not NULL. (closes https://github.com/vim/vim/issues/11020) diff --git a/src/gui_x11.c b/src/gui_x11.c --- a/src/gui_x11.c +++ b/src/gui_x11.c @@ -2231,10 +2231,14 @@ gui_x11_create_blank_mouse(void) { 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); + + 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); + (XColor*)&gui.norm_pixel, (XColor*)&gui.norm_pixel, 0, 0); } /* diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -708,6 +708,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 339, +/**/ 338, /**/ 337,