From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8NWDELAlAWB7NgAAWB0awg (envelope-from ) for ; Fri, 15 Jan 2021 00:18:40 -0500 Received: by simark.ca (Postfix, from userid 112) id 2A8211E945; Fri, 15 Jan 2021 00:18:40 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id AFBF01E945 for ; Fri, 15 Jan 2021 00:18:39 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1D41D3835406; Fri, 15 Jan 2021 05:18:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D41D3835406 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610687919; bh=ecor1zPXSmaYhLrr/Kp/bNnJOahCpoXPscnyucyITt8=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=whPE4eD6SOGNTfZMrwTKbSeT24dDUBwy8vzQEZehy6EEgrWFjaBXWA+tvibr0Ej9z UU4eJY98Gp8JB4RhkpbHmvQG7tknHy4Orh/BYV2gZhrMb3H87wCkvFHU+kHmhxuOWY m7dw1l6OEeeS2oU59ilzynI2uFe2ajxFWQlKvChE= Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id B0FFB3835406 for ; Fri, 15 Jan 2021 05:18:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B0FFB3835406 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id B0E70340DB1; Fri, 15 Jan 2021 05:18:35 +0000 (UTC) Date: Fri, 15 Jan 2021 00:18:35 -0500 To: =?utf-8?B?0J/QsNCy0LXQuyDQmtGA0Y7QutC+0LI=?= Subject: Re: [PATCH] sim-utils.c: prevent buffer overflow. Message-ID: <20210115051835.GN6938@vapier> Mail-Followup-To: =?utf-8?B?0J/QsNCy0LXQuyDQmtGA0Y7QutC+0LI=?= , Simon Marchi , gdb-patches@sourceware.org, Andrew Burgess References: <969988fa-470f-9013-9948-dfff11922067@simark.ca> <3BB98D48-787F-49C4-81F4-736AFFF3516C@frtk.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1HuzLmPZrG5RH6bG" Content-Disposition: inline In-Reply-To: <3BB98D48-787F-49C4-81F4-736AFFF3516C@frtk.ru> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: Simon Marchi , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" --1HuzLmPZrG5RH6bG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 01 Dec 2019 18:33, =D0=9F=D0=B0=D0=B2=D0=B5=D0=BB =D0=9A=D1=80=D1=8E=D0= =BA=D0=BE=D0=B2 wrote: > 1 =D0=B4=D0=B5=D0=BA. 2019 =D0=B3., =D0=B2 17:46, Simon Marchi =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): > > Is the sim built in C++ like GDB? If so, maybe this function could ret= urn > > an std::string, so there's no more concerns of allocating a static buff= er > > with sufficient space? > > No, simulators are built in C. Probably they may be switched to C++, but = that would require more effort; plus, there may be external C simulators. i've been thinking about the sim & C-vs-C++. the only reason i hesitate to go all in is that we provide libsim.a for people to link the runtime into other programs, and providing a static lib that requires C++ feels wrong. gdb has the advantage that it doesn't provide a library interface. maybe it should ... -mike --1HuzLmPZrG5RH6bG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmABJasACgkQQWM7n+g3 9YGizQ/+IYxQZOvG7yOj1E9ZOWZGd3ZDmOTdAIrUFfVwS+S3GxbFLWgmiDxjQMgC KQKRw7UPgfGa0v5BZypCYs4B3dQrn7/qyAFVFHlXbh/2jIFDksFReAWtagqk9ch5 MVLE/OopACNJLZDtDBlwPseV1Kwwo9SRk80QP2Tv6Vz3HGP7ldfABKlBxZWoNE1p vf4b7Sh3AuxG5uwAeEwnu8+K8clhId5qgyw0iANKF5aDyM/J14KIq5b8cILW9PoM Kg0aaTRnDqqxRfhRYK5ZlbxTaNCATAUAVSDkc4/p7W+MxER/hnqdGBVkwtQwhvUc Hmqc2mi+MgJLJWe0+4SRbnSanlJ20hJY7B7px4tl+nEzLAcwwGa1THCvx9UQft7i YderjCtezVkemUD9HIuffb2rNKpSoUTmO2vjjLNghAPg5LctCmzqYJ4NzSFREP19 Ydpy1Mj6kfps26A6X9LXcPNbD0ggNI+rsHnMmJRU2SxKk5rGk1IE98LBG7CfgzDr liFQFZDKhATLCDl2mpA81dOctVsKxOH3yxj+j3HLNuOnecJD+MkoG94Su+/3lKyT SMQYnvMIcbXUI1xWQ71KMhzwnqfipiDcv9gAYGTzkEYQlhPBoaOdu/dX48N6gFCw bfZs4Rp1jNeRnvLlNFDV9JJy+MOfjiqN+dJiYyeo4aykT6SHo+0= =rMDT -----END PGP SIGNATURE----- --1HuzLmPZrG5RH6bG--