From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28744 invoked from network); 18 Sep 2023 13:00:40 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 18 Sep 2023 13:00:40 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by 9front; Mon Sep 18 08:59:15 -0400 2023 Received: from abbatoir (pool-108-6-24-2.nycmny.fios.verizon.net [108.6.24.2]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 5a788b14 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Mon, 18 Sep 2023 05:59:11 -0700 (PDT) Message-ID: To: 9front@9front.org Date: Mon, 18 Sep 2023 08:59:10 -0400 From: ori@eigenstate.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: extended map/reduce information hosting Subject: Re: [9front] [PATCH] libjson: make sure string contains only a single JSON value Reply-To: 9front@9front.org Precedence: bulk Quoth Kristo : > 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; > } thanks, committed.