shithub: riscv

Download patch

ref: 6bfff754a84335c4016c74792927b1353f1a686b
parent: 3a6a754051a6f3f1ba742f12be0a2c33d309ca53
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Jul 9 19:55:54 EDT 2014

abaco: fix double free race of p->status string (thanks BurnZeZ for the proc snap)

--- a/sys/src/cmd/abaco/util.c
+++ b/sys/src/cmd/abaco/util.c
@@ -962,12 +962,12 @@
 	if(s == nil)
 		error("runevsmprint failed");
 
+	qlock(&refreshlock);
 	if(p->status){
 		free(p->status);
 		p->status = nil;
 	}
 	p->status = s;
-	qlock(&refreshlock);
 	for(r=refreshs; r!=nil; r=r->next)
 		if(r->p == p)
 			goto Return;