]> git.lizzy.rs Git - plan9front.git/commitdiff
kernel: fix off by one for $cputype buffer (thanks anthony martin)
authorcinap_lenrek <cinap_lenrek@felloff.net>
Wed, 28 Jul 2021 22:55:17 +0000 (22:55 +0000)
committercinap_lenrek <cinap_lenrek@felloff.net>
Wed, 28 Jul 2021 22:55:17 +0000 (22:55 +0000)
sys/src/9/boot/boot.c

index a8e08f91a3d1c90bf6388e9b7b5b7a496d2336c5..51daee7a05fe7c5c8b8c03c6418a4c3970889272 100644 (file)
@@ -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);