From 5076ec15867c21dffc023bf7462e397cf2203a46 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 31 Aug 2020 14:33:25 +0200 Subject: [PATCH] Fix buffer overflow when reading WM_NAME XTextProperty doesn't guarantee the string will be null-terminated. --- src/steamcompmgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index b74c8b7..fc44444 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -1540,7 +1540,7 @@ map_win (Display *dpy, Window id, unsigned long sequence) XTextProperty tp; XGetTextProperty ( dpy, id, &tp, XA_WM_NAME ); - if ( tp.value && strcmp( (const char*)tp.value, "SP" ) == 0 ) + if ( tp.value && strncmp( (char *)tp.value, "SP", tp.nitems ) == 0 ) { w->isSteamPopup = True; }