From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id da3db3d3 for ; Tue, 12 Nov 2019 22:50:11 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id C3EDD9C14F; Wed, 13 Nov 2019 08:50:10 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 95D2D9BB5B; Wed, 13 Nov 2019 08:49:55 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; unprotected) header.d=kilonet.net header.i=@kilonet.net header.b="fmdTooZn"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 713EC9BB5B; Wed, 13 Nov 2019 08:49:53 +1000 (AEST) Received: from p3plsmtpa06-07.prod.phx3.secureserver.net (p3plsmtpa06-07.prod.phx3.secureserver.net [173.201.192.108]) by minnie.tuhs.org (Postfix) with ESMTPS id 089C19BB16 for ; Wed, 13 Nov 2019 08:49:53 +1000 (AEST) Received: from medusa.kilonet.net ([72.69.223.115]) by :SMTPAUTH: with ESMTPA id UeytifLehz03vUeyuiyc4L; Tue, 12 Nov 2019 15:49:52 -0700 Received: from [199.89.231.101] (ender.kilonet.net [199.89.231.101]) by medusa.kilonet.net (8.14.8/8.15.1) with ESMTP id xACMnpIG009204 for ; Tue, 12 Nov 2019 17:49:51 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kilonet.net; s=default; t=1573598991; bh=Ev3Cp3j4PusyaIq2NPwydudIKYPMxOSAYKt8kcZyOy0=; h=Subject:To:References:From:Date:In-Reply-To; b=fmdTooZnfDtuTTym43L2Yw4tP26mf+17VwT1IhGPErEAiwnr49dIupBx9ZFziJHB0 WgHG6hjDfbMCm7QFatukGPJZGR8tf2JaDrU10y6gxiCN+kHbLmrTbxJ8I12+FWTZN9 6prvN9Dw/s5ojraHJVW0Ru2BQrS/MlZ2LxNosntA= To: tuhs@minnie.tuhs.org References: <1573592179.5935.for-standards-violators@oclsc.org> <20191112221053.C2009156E80B@mail.bitblocks.com> <20191112221418.GJ16268@mcvoy.com> <20191112224151.GA36336@fuz.su> From: Arthur Krewat Message-ID: <5d8d9933-1213-3f07-02e0-f3ad5c293de4@kilonet.net> Date: Tue, 12 Nov 2019 17:49:46 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20191112224151.GA36336@fuz.su> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-CMAE-Envelope: MS4wfHe9KIclMatwlTTVYiQoDldTvMTQqAAPSiE4O4pscD6qCMZcC8spcqSgoJjpXeC7N6BaWjJUDLJYNoeVA5yYw10BbecyC1Ctg+SKNf0WpVqFrcXSP5Gt CSFhO1oeVZFBj4YBq9PqnB9UHTpxKwiLao+pxycHE13sDjjPwKi9UZRiSDkc+mYcljslzqve62uPxw== Subject: Re: [TUHS] buffer overflow (Re: Happy birthday Morris worm X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On 11/12/2019 5:41 PM, Robert Clausecker wrote: > Oh please no. One of the things we've hopefully all learned from Pascal > is that length-prefixed strings suck because you can't perform anything > useful without copying the entire string. Rob Pike and friends showed > how to get strings and vectors right in the Go language where you have a > builtin slice type which is essentially a structure > > struct slice(type) { > type *data; > size_t len, cap; > }; And none of that stops some programmer from doing slice.cap=255 - or is it read-only? ;)