From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: yoann padioleau In-Reply-To: <10C19402-24DC-4B30-AD02-F83E12362D5D@gmail.com> Date: Tue, 9 Dec 2014 17:19:02 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <10C19402-24DC-4B30-AD02-F83E12362D5D@gmail.com> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] memory bug in 5l Topicbox-Message-UUID: 35fb196a-ead9-11e9-9d60-3106f5b1d025 There is a related bug still in this file in ldobj() I think: if(nhunk < sizeof(Prog)) gethunk(); p =3D (Prog*)hunk; nhunk -=3D sizeof(Prog); hunk +=3D sizeof(Prog); it should be while(chunk < sizeof(Prog)) (or even better again, a simple call to malloc(sizeof(Prog)) On Dec 9, 2014, at 4:21 PM, yoann padioleau = wrote: > in 5l/obj.c#zaddr() > there is: > case D_FCONST: > while(nhunk < sizeof(Ieee)) > gethunk(); > a->ieee =3D (Ieee*)hunk; > nhunk -=3D NSNAME; > hunk +=3D NSNAME; >=20 > I think it=92s a copy paste bug, it should > be sizeof(Ieee) instead of those NSNAME > (or even better the whole code could be factorized > in a call to a->ieee =3D malloc(sizeof(Ieee)); >=20