Commit Briefs

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.


GitHub

src/cmd/acme: provide info on presense or absence of undo history (#528)

It's sometimes useful to know whether there's been editing activity in a window. This PR adds that information to the ctl file. Change-Id: I21a342ac636dd5c7701b3ed560e3526867329c2c




Dan Cross

mk: provide a mechanism to default to `rc`

For cross-compiling plan9 from Unix, provide a way to force `mk` to use `rc` instead of `sh` without setting `MKSHELL` in individual `mkfile`s. If the environment variable `FORCERCFORMK` is set, `mk` will default to using `rc`, not `sh`. Signed-off-by: Dan Cross <cross@gajendra.net>


Russ Cox

sam: fix spurious overwrite message

Fixes: % sam -d -. w foo foo: (new file) #0 w foo ?warning: write might change good version of `foo'