shithub: riscv

Download patch

ref: 330e7ef39b9a4afa6f484b80bdc3684603c83387
parent: dad00a77da3ebfd0f6fa725dbbc98469984b2341
author: cinap_lenrek <[email protected]>
date: Wed Sep 27 09:59:55 EDT 2017

kernel: don't tokenize inplace in isaconfig() to make /dev/reboot work

--- a/sys/src/9/pc/devarch.c
+++ b/sys/src/9/pc/devarch.c
@@ -1182,7 +1182,7 @@
 int
 isaconfig(char *class, int ctlrno, ISAConf *isa)
 {
-	char cc[32], *p;
+	char cc[32], *p, *x;
 	int i;
 
 	snprint(cc, sizeof cc, "%s%d", class, ctlrno);
@@ -1189,6 +1189,10 @@
 	p = getconf(cc);
 	if(p == nil)
 		return 0;
+
+	x = nil;
+	kstrdup(&x, p);
+	p = x;
 
 	isa->type = "";
 	isa->nopt = tokenize(p, isa->opt, NISAOPT);