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 16668 invoked from network); 7 Aug 2023 22:17:34 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 7 Aug 2023 22:17:34 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by 9front; Mon Aug 7 18:16:23 -0400 2023 Received: from stockyard (ool-ae2cb074.dyn.optonline.net [174.44.176.116]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 83fb4336 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Mon, 7 Aug 2023 15:16:20 -0700 (PDT) Message-ID: <6575DE7A54A7FDF51A333B852589E850@eigenstate.org> To: 9front@9front.org Date: Mon, 07 Aug 2023 18:16:18 -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: cache-aware hypervisor-aware YAML package wrapper strategy 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 > @@ -328,6 +328,13 @@ > > j = jsonobj(&l); > free(l.buf); > + > + if(peeknonspace(&l) != 0){ does this use the `l.buf` that we free one line up? > + jsonfree(j); > + werrstr("json: unexpected trailing data"); > + return nil; > + } > + > return j; > }