Commit Briefs


Dan Cross

factotum: plug a memory leak in apop



Dan Cross

devdraw/x11: fix modifier key handling for some XkbOptions

Certain XkbOptions in X11 would change keysyms for modifier keys between the key press and key release. For example, under the XkbOptions "grp:shifts_toggle", though shift keys remain Shift_L/R when pressed, they become ISO_Group_Next/Prev when released. This behavior makes devdraw unable to detect the release event correctly and as a result mouse button 1 click always interpreted as button 3 event after a shift key is used.



Dan Cross

libdraw: fix out-of-bounds access to local buffer in event.c:startrpc()

The function `startrpc()` stack allocates a local buffer of size 100: ```c static Muxrpc* startrpc(int type) { uchar buf[100]; ^^^^^^^^ Wsysmsg w; w.type = type; convW2M(&w, buf, sizeof buf); return muxrpcstart(display->mux, buf); } ``` The function `convW2M()` is called passing `buf`. That function accesses `buf` out-of-bounds: ```c uint convW2M(Wsysmsg *m, uchar *p, uint n) { ... case Tcursor2: PUT(p+6, m->cursor.offset.x); PUT(p+10, m->cursor.offset.y); memmove(p+14, m->cursor.clr, sizeof m->cursor.clr); memmove(p+46, m->cursor.set, sizeof m->cursor.set); PUT(p+78, m->cursor2.offset.x); PUT(p+82, m->cursor2.offset.y); memmove(p+86, m->cursor2.clr, sizeof m->cursor2.clr); memmove(p+214, m->cursor2.set, sizeof m->cursor2.set); p[342] = m->arrowcursor; ^^^^^^ ``` To fix the issue the size of local variable `buf` is increased from 100 to 512 to avoid out-of-bounds array access.


Dan Cross

fossil: fix EOF detection when reading 9P message

When the 9P connection is closed, reads on the connection will keep returning 0. So, fossil ends up looping forever, trying to read a 9P message, consuming 100% CPU. The fix interprets 0 bytes read as EOF. Reproduce by killing the 9pserve process serving the fossil service, or by listening on tcp and using 9p(1).



Dan Cross

trim button & modbutton images


Dan Cross

make sure border has correct height


Dan Cross

src/cmd/fontsrv: pad subfile names to support correct file length

For fonts with subfiles that go beyond the xffff range, the font file size calculation is incorrect, since lines beyond that range have additional characters. This patch pads all of the ranges and subfont names with leading zeros in order to keep them all lines the same length and fixes the font file length calculation.


Dan Cross

acme: Don't move the mouse if button depressed

Fixes #19


Dan Cross

rc: remove dead code.

kencc warns that this code is dead.



Russ Cox

INSTALL: build arm64 binaries on arm64 Macs

If there is any x86 binary in the chain of parent processes from the current one, then uname -m prints x86_64 and clang defaults to building x86_64 binaries. Detect arm64 using the kernel version and force building an arm64 toolchain instead of perpetuating x86. This is particularly important when the user shell is rc, which has been built for x86, because then rebuilding under rc continues to use x86.