[hackers] [dwm][PATCH] Avoid unsigned integer underflow in drw_text()

From: Raymond Cole <rc_AT_wolog.xyz>
Date: Mon, 28 Oct 2024 00:34:55 +0000

---
 drw.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drw.c b/drw.c
index 344de61..c41e6af 100644
--- a/drw.c
+++ b/drw.c
_AT_@ -248,6 +248,8 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
 	} else {
 		XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
 		XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
+		if (w < lpad)
+			return x + w;
 		d = XftDrawCreate(drw->dpy, drw->drawable,
 		                  DefaultVisual(drw->dpy, drw->screen),
 		                  DefaultColormap(drw->dpy, drw->screen));
-- 
2.46.2
Received on Mon Oct 28 2024 - 01:34:55 CET

This archive was generated by hypermail 2.3.0 : Mon Oct 28 2024 - 01:36:38 CET