git: 9front

Download patch

ref: e9574b69c9248b60983006e72e1fc3498df22ac9
parent: 5f568ebde71f53e9bb926496e2fbbd49a88d699e
parent: d20d7f7892d137c6c72544dfc2a7c76f1bccb7d8
author: ben <ben@rana>
date: Wed Apr 27 04:20:54 EDT 2016

merge in master

--- a/sys/src/libjson/json.c
+++ b/sys/src/libjson/json.c
@@ -323,7 +323,7 @@
 	memset(&l, 0, sizeof(l));
 	l.s = s;
 	l.slen = strlen(s);
-	if((l.buf = mallocz(l.slen+1, 1)) == nil)
+	if((l.buf = mallocz(l.slen+UTFmax+1, 1)) == nil)
 		return nil;
 
 	j = jsonobj(&l);
@@ -336,6 +336,8 @@
 {
 	JSONEl *e, *f;
 
+	if(j == nil)
+		return;
 	switch(j->t){
 	case JSONString:
 		if(j->s)
--