Re: [dev] [dwm] [PATCH] NULL byte in WM_NAME

From: Kernc <kerncece_AT_gmail.com>
Date: Wed, 27 Dec 2017 12:23:04 +0100

> first off, thank you very much for this well-written report! I'm sure
> everyone agrees that more should start like this; it saves everyone
> involved in reading a good amount of time.

Thanks. :)

> Maybe it was set this way in the first place to prevent possible
> accidents from happening, like somebody using XGetProperty and
> forgetting that the given string is not NUL-terminated or something.
> However, I generally do not support this kind of pre-thought, as any
> tool containing this bug would break on any other wm which does not
> NUL-terminate its name in the X-property.

XGetWindowProperty() always allocates one extra byte in prop_return
(even if the property is zero length) and sets it to zero so that simple
properties consisting of characters do not have to be copied into yet
another string before use.

https://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html
Received on Wed Dec 27 2017 - 12:23:04 CET

This archive was generated by hypermail 2.3.0 : Wed Dec 27 2017 - 12:36:09 CET