<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ndpm13/dwm, branch master</title>
<subtitle>My Build of DWM</subtitle>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/'/>
<entry>
<title>dwm: Fix getatomprop regression from heap overflow fix</title>
<updated>2026-01-16T13:13:51+00:00</updated>
<author>
<name>Chris Down</name>
<email>chris@chrisdown.name</email>
</author>
<published>2026-01-14T06:58:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/commit/?id=a9aa0d8ffbb548b0b1f9f755557aef2482c0f820'/>
<id>a9aa0d8ffbb548b0b1f9f755557aef2482c0f820</id>
<content type='text'>
Commit 244fa852fe27 ("dwm: Fix heap buffer overflow in getatomprop")
introduced a check for dl &gt; 0 before dereferencing the property pointer.
However, I missed that the variable dl is passed to XGetWindowProperty
for both nitems_return and bytes_after_return parameters:

    XGetWindowProperty(..., &amp;dl, &amp;dl, &amp;p)

The final value in dl is bytes_after_return, not nitems_return. For a
successfully read property, bytes_after is typically 0 (indicating all
data was retrieved), so the check `dl &gt; 0` is always false and dwm never
reads any atom properties. So this is safe, but not very helpful :-)

dl is probably just a dummy variable anyway, so fix by using a separate
variable for nitems, and check nitems &gt; 0 as originally intended.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 244fa852fe27 ("dwm: Fix heap buffer overflow in getatomprop")
introduced a check for dl &gt; 0 before dereferencing the property pointer.
However, I missed that the variable dl is passed to XGetWindowProperty
for both nitems_return and bytes_after_return parameters:

    XGetWindowProperty(..., &amp;dl, &amp;dl, &amp;p)

The final value in dl is bytes_after_return, not nitems_return. For a
successfully read property, bytes_after is typically 0 (indicating all
data was retrieved), so the check `dl &gt; 0` is always false and dwm never
reads any atom properties. So this is safe, but not very helpful :-)

dl is probably just a dummy variable anyway, so fix by using a separate
variable for nitems, and check nitems &gt; 0 as originally intended.
</pre>
</div>
</content>
</entry>
<entry>
<title>bump version to 6.7</title>
<updated>2026-01-10T10:31:44+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2026-01-10T10:31:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/commit/?id=85fe518c1af5eb43f222f4d8579e4814ed769f3b'/>
<id>85fe518c1af5eb43f222f4d8579e4814ed769f3b</id>
<content type='text'>
Put the maintainer at the top and bump years (time flies).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Put the maintainer at the top and bump years (time flies).
</pre>
</div>
</content>
</entry>
<entry>
<title>dwm: Fix heap buffer overflow in getatomprop</title>
<updated>2026-01-10T10:27:23+00:00</updated>
<author>
<name>Chris Down</name>
<email>chris@chrisdown.name</email>
</author>
<published>2026-01-07T14:02:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/commit/?id=244fa852fe2775cf52a3901966cd6d8700df8227'/>
<id>244fa852fe2775cf52a3901966cd6d8700df8227</id>
<content type='text'>
When getatomprop() is called, it invokes XGetWindowProperty() to
retrieve an Atom. If the property exists but has zero elements (length
0), Xlib returns Success and sets p to a valid, non-NULL memory address
containing a single null byte.

However, dl (that is, the number of items) is 0. dwm blindly casts p to
Atom* and dereferences it. While Xlib guarantees that p is safe to read
as a string (that is, it is null-terminated), it does _not_ guarantee it
is safe to read as an Atom (an unsigned long).

The Atom type is a typedef for unsigned long. Reading an Atom (which
thus will either likely be 4 or 8 bytes) from a 1-byte allocated buffer
results in a heap buffer overflow. Since property content is user
controlled, this allows any client to trigger an out of bounds read
simply by setting a property with format 32 and length 0.

An example client which reliably crashes dwm under ASAN:

    #include &lt;X11/Xlib.h&gt;
    #include &lt;X11/Xatom.h&gt;
    #include &lt;stdio.h&gt;
    #include &lt;stdlib.h&gt;
    #include &lt;unistd.h&gt;

    int main(void) {
        Display *d;
        Window root, w;
        Atom net_wm_state;

        d = XOpenDisplay(NULL);
        if (!d) return 1;

        root = DefaultRootWindow(d);
        w = XCreateSimpleWindow(d, root, 10, 10, 200, 200, 1, 0, 0);
        net_wm_state = XInternAtom(d, "_NET_WM_STATE", False);
        if (net_wm_state == None) return 1;

        XChangeProperty(d, w, net_wm_state, XA_ATOM, 32,
                        PropModeReplace, NULL, 0);
        XMapWindow(d, w);
        XSync(d, False);
        sleep(1);

        XCloseDisplay(d);
        return 0;
    }

In order to avoid this, check that the number of items returned is
greater than zero before dereferencing the pointer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When getatomprop() is called, it invokes XGetWindowProperty() to
retrieve an Atom. If the property exists but has zero elements (length
0), Xlib returns Success and sets p to a valid, non-NULL memory address
containing a single null byte.

However, dl (that is, the number of items) is 0. dwm blindly casts p to
Atom* and dereferences it. While Xlib guarantees that p is safe to read
as a string (that is, it is null-terminated), it does _not_ guarantee it
is safe to read as an Atom (an unsigned long).

The Atom type is a typedef for unsigned long. Reading an Atom (which
thus will either likely be 4 or 8 bytes) from a 1-byte allocated buffer
results in a heap buffer overflow. Since property content is user
controlled, this allows any client to trigger an out of bounds read
simply by setting a property with format 32 and length 0.

An example client which reliably crashes dwm under ASAN:

    #include &lt;X11/Xlib.h&gt;
    #include &lt;X11/Xatom.h&gt;
    #include &lt;stdio.h&gt;
    #include &lt;stdlib.h&gt;
    #include &lt;unistd.h&gt;

    int main(void) {
        Display *d;
        Window root, w;
        Atom net_wm_state;

        d = XOpenDisplay(NULL);
        if (!d) return 1;

        root = DefaultRootWindow(d);
        w = XCreateSimpleWindow(d, root, 10, 10, 200, 200, 1, 0, 0);
        net_wm_state = XInternAtom(d, "_NET_WM_STATE", False);
        if (net_wm_state == None) return 1;

        XChangeProperty(d, w, net_wm_state, XA_ATOM, 32,
                        PropModeReplace, NULL, 0);
        XMapWindow(d, w);
        XSync(d, False);
        sleep(1);

        XCloseDisplay(d);
        return 0;
    }

In order to avoid this, check that the number of items returned is
greater than zero before dereferencing the pointer.
</pre>
</div>
</content>
</entry>
<entry>
<title>drw.c: drw_scm_free: call free inside</title>
<updated>2025-09-29T16:48:27+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2025-09-29T16:48:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/commit/?id=7c3abae4e68b6a21f05cb04f3af31217259c0aa9'/>
<id>7c3abae4e68b6a21f05cb04f3af31217259c0aa9</id>
<content type='text'>
Because drw_scm_create() allocates it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because drw_scm_create() allocates it.
</pre>
</div>
</content>
</entry>
<entry>
<title>cleanup schemes and colors</title>
<updated>2025-09-27T10:10:17+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2025-09-27T10:10:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/commit/?id=93f26863d14666e56e992de3670a77178e66ddf2'/>
<id>93f26863d14666e56e992de3670a77178e66ddf2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>config: make refreshrate for mouse move/resize a config option</title>
<updated>2025-08-12T17:17:20+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2025-08-12T17:17:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/commit/?id=74edc27caa65aba9ea8d1fe03d26e3b449f79590'/>
<id>74edc27caa65aba9ea8d1fe03d26e3b449f79590</id>
<content type='text'>
Bump the default from 60 to 120.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bump the default from 60 to 120.
</pre>
</div>
</content>
</entry>
<entry>
<title>bump version to 6.6</title>
<updated>2025-08-09T12:34:03+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2025-08-09T12:34:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/commit/?id=693d94d350c806e77677c35958e18590c26e19d2'/>
<id>693d94d350c806e77677c35958e18590c26e19d2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid unsigned integer underflow in drw_text()</title>
<updated>2024-10-30T12:02:17+00:00</updated>
<author>
<name>Raymond Cole</name>
<email>rc@wolog.xyz</email>
</author>
<published>2024-10-28T00:34:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/commit/?id=cfb8627a80a334f200f68c2c8f3e384313ebbaf5'/>
<id>cfb8627a80a334f200f68c2c8f3e384313ebbaf5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>util.c: output function might override errno and thus affect perror()</title>
<updated>2024-10-27T19:10:07+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2024-10-27T19:10:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/commit/?id=fcb2476b693ca4c40ad32c7119e27bbeb856865c'/>
<id>fcb2476b693ca4c40ad32c7119e27bbeb856865c</id>
<content type='text'>
Original patch by Raymond Cole with some modifications, thanks!
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Original patch by Raymond Cole with some modifications, thanks!
</pre>
</div>
</content>
</entry>
<entry>
<title>sync drw.{c,h} from dmenu</title>
<updated>2024-10-05T11:06:08+00:00</updated>
<author>
<name>Hiltjo Posthuma</name>
<email>hiltjo@codemadness.org</email>
</author>
<published>2024-10-05T11:01:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.unix-goblins.xyz/ndpm13/dwm/commit/?id=8933ebcf50024f4378a78e556b1ac08091197206'/>
<id>8933ebcf50024f4378a78e556b1ac08091197206</id>
<content type='text'>
- drw: minor improvement to the nomatches cache
- overhaul utf8decoding and render invalid utf8 sequences as U+FFFD.

Thanks NRK for these improvements!
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- drw: minor improvement to the nomatches cache
- overhaul utf8decoding and render invalid utf8 sequences as U+FFFD.

Thanks NRK for these improvements!
</pre>
</div>
</content>
</entry>
</feed>
