From 84b77568cda98a21dd4f3403a94c56724fbd5b37 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Wed, 28 Jul 2021 22:55:17 +0000 Subject: [PATCH] kernel: fix off by one for $cputype buffer (thanks anthony martin) --- sys/src/9/boot/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.44.0