From: cinap_lenrek Date: Wed, 28 Jul 2021 22:55:17 +0000 (+0000) Subject: kernel: fix off by one for $cputype buffer (thanks anthony martin) X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=84b77568cda98a21dd4f3403a94c56724fbd5b37;p=plan9front.git kernel: fix off by one for $cputype buffer (thanks anthony martin) --- diff --git a/sys/src/9/boot/boot.c b/sys/src/9/boot/boot.c index a8e08f91a..51daee7a0 100644 --- a/sys/src/9/boot/boot.c +++ b/sys/src/9/boot/boot.c @@ -22,7 +22,7 @@ main(int, char *argv[]) bind(root, "/", MAFTER); buf[0] = '/'; - buf[1+read(open("/env/cputype", OREAD|OCEXEC), buf+1, sizeof buf - 5)] = '\0'; + buf[1+read(open("/env/cputype", OREAD|OCEXEC), buf+1, sizeof buf - 6)] = '\0'; strcat(buf, bin); bind(buf, bin, MAFTER); bind("/rc/bin", bin, MAFTER);