From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.user Subject: Re: Guile bugs Date: Mon, 11 Sep 2017 13:34:46 +0200 Message-ID: <87vakpa2p5.fsf@gnu.org> References: <87lgtajpkc.fsf@web.de> <87h8y7ruuz.fsf_-_@gnu.org> <87y3pm7l6j.fsf@gnu.org> <87wp55elvs.fsf@gnu.org> <87k215odtc.fsf@elektro.pacujo.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1505325131 14099 195.159.176.226 (13 Sep 2017 17:52:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Sep 2017 17:52:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: Guile User To: Marko Rauhamaa Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Sep 11 13:49:58 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drNDg-0005Mr-9A for guile-user@m.gmane.org; Mon, 11 Sep 2017 13:49:40 +0200 Original-Received: from localhost ([::1]:56968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drNDn-0008AM-HH for guile-user@m.gmane.org; Mon, 11 Sep 2017 07:49:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drMzN-0004tB-Nl for guile-user@gnu.org; Mon, 11 Sep 2017 07:34:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drMzK-0002cw-IE for guile-user@gnu.org; Mon, 11 Sep 2017 07:34:53 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drMzK-0002cs-Er; Mon, 11 Sep 2017 07:34:50 -0400 Original-Received: from [193.50.110.231] (port=47742 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1drMzJ-00018c-Tl; Mon, 11 Sep 2017 07:34:50 -0400 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 25 Fructidor an 225 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87k215odtc.fsf@elektro.pacujo.net> (Marko Rauhamaa's message of "Mon, 11 Sep 2017 11:10:55 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14134 Hi Marko, Marko Rauhamaa skribis: > ludo@gnu.org (Ludovic Court=C3=A8s): > >> I don=E2=80=99t know to what extent that is applicable to your software,= but my >> recommendation would be to treat that network socket as a Scheme port, >> pass it to =E2=80=98read=E2=80=99, and pass the result to =E2=80=98eval= =E2=80=99 (as opposed to reading >> the whole string from C++ and passing it to =E2=80=98scm_eval_string=E2= =80=99.) > > Octet stream sockets break the stream at arbitrary locations. Eval isn't > going to like it if you blindly hand bytes over to it. You first need to > break the stream into complete S-expressions. Sure, that=E2=80=99s what the =E2=80=98read=E2=80=99 part above does. > Secondly, this lucrative pattern can be very dangerous as it allows > arbitrary code to be executed at the peer end. In most applications, it > is better to interpret the S-expressions explicitly. Definitely. I=E2=80=99m not saying eval-over-the-network is a good thing t= o do in general, mind you! :-) Ludo=E2=80=99.