9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH] libjson: make sure string contains only a single JSON value
@ 2023-08-07 15:29 Kristo
  2023-08-07 22:16 ` ori
  2023-09-18 12:59 ` ori
  0 siblings, 2 replies; 5+ messages in thread
From: Kristo @ 2023-08-07 15:29 UTC (permalink / raw)
  To: 9front

diff bf645afaac246967b9590ae7463f243c11d97480 uncommitted
--- a/sys/src/libjson/json.c
+++ b/sys/src/libjson/json.c
@@ -328,6 +328,13 @@

 	j = jsonobj(&l);
 	free(l.buf);
+
+	if(peeknonspace(&l) != 0){
+		jsonfree(j);
+		werrstr("json: unexpected trailing data");
+		return nil;
+	}
+
 	return j;
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-18 13:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-07 15:29 [9front] [PATCH] libjson: make sure string contains only a single JSON value Kristo
2023-08-07 22:16 ` ori
2023-08-08 14:44   ` [9front] " Kristo
2023-09-18 11:26     ` Kristo
2023-09-18 12:59 ` ori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).