Fix buffer overflow when reading WM_NAME

XTextProperty doesn't guarantee the string will be null-terminated.
This commit is contained in:
Simon Ser 2020-08-31 14:33:25 +02:00
parent 6eb108d3bc
commit 5076ec1586
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -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;
}