From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13737 invoked by alias); 14 Jan 2018 20:41:11 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42281 Received: (qmail 14470 invoked by uid 1010); 14 Jan 2018 20:41:11 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf0-f49.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.215.49):SA:0(-1.9/5.0):. Processed in 0.510498 secs); 14 Jan 2018 20:41:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RbMwCVYU/gH15odAl0NMvXljsf7Rq3I0f2LddLZ0QW8=; b=LHpF4Bu4PH/jXFDqij3xrwRA9orvo9WFW1fACTstXP4paGjJfp8wfGbK7VylttWotx AGyAoWX7BB6a5wBYtX6vbFSRWJbSsL4yS30gJjj1mIvUpTi4KuibfKlCp57tt0idQSgm /EgXTeyLCm60MSRbviMvDEt6NVTRNAXbNUj8ZuA6hmXT1RGDo90A7Bl4BPsyGgAghjJj 5TubKUqqM4OB3Hu8rxqgPQifpDm8x7A0QzQb/jC+cXkyeogNnO6LNRpLtvSL8zgCw7ac Ubwe9I5fel43eN0R20xIHVz6AY2yt9GUDF/vfYmTF7MkQeKQLqZqoVjGB7S5ooSSC543 BsiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RbMwCVYU/gH15odAl0NMvXljsf7Rq3I0f2LddLZ0QW8=; b=IHd9wS5wsjpR6J/2vrmNQqiE2ROy7h+sWJrNJF+RhPghjscVKDKLgcZ1CP9Vc9AwKC c5PLcPAc0t5OJTBKsDS+V1VhNDkZF0fE4ne1tdN8fv4zG7I1JKzyaidfSB7944HuQKgr 9lsi6vWTUrxU9qS0IGhCKZwonKgqL6lvU2qsJdfC8m1Sz7GrLU5Gjy4hQ/tN2fBuuwnK M+ruC8kH9Ra44U9ZRgBsUXM798JMpf2+JJzUSIe95sILF4QtP2DQEdygmP1RNnVzYJhd SGgNoKgg6bfvQegs3HDc+p/EX7IpBmKkXPjOmX1IOA9eDWeraRhKbJwUNCK75Uo3i5PK 4KBA== X-Gm-Message-State: AKwxytfwj24gPnnaLuIk8GuNILIQrrSe9qzkWSL8FYrdo35CF6rEvDbQ d1QglkqSh7sD+deuvgqt6YEIcJhBHp2GlpRwchiOog== X-Google-Smtp-Source: ACJfBot6pMCANsgOwqZWlY+mZDMe1DGwU+0Jg87nfb9fBWwX8M6an6WbmdykFhUsNZeO92XunbLGC+FaglJ3vnqKDd0= X-Received: by 10.25.27.211 with SMTP id b202mr14709550lfb.64.1515962465916; Sun, 14 Jan 2018 12:41:05 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20180114152344.12018-1-joeypabalinas@gmail.com> References: <20180114152344.12018-1-joeypabalinas@gmail.com> From: Bart Schaefer Date: Sun, 14 Jan 2018 12:41:05 -0800 Message-ID: Subject: Re: [PATCH 0/3] jp: Patchset for parameter expansion segfaults To: "zsh-workers@zsh.org" Cc: dana , Joey Pabalinas Content-Type: text/plain; charset="UTF-8" On Sun, Jan 14, 2018 at 7:23 AM, Joey Pabalinas wrote: > > Joey Pabalinas (3): > - Fix segfaults during parameter expansion > - Use `(nil)` for empty identifier strings > - Add `dupstring()` fallback to `zhtricat()` With appreciation for your efforts here, preventing segfaults is not the correct goal. The goal should be that the software produces the correct results. Trapping bad pointers in the string copy/catenate routines potentially masks more serious errors; it introduces what only appears to be error-free operation in cases that probably ought to fail. A segfault in zhtricat() is nearly always an indication that the calling code is doing something wrong, and covering that up only makes it harder to find what that is. At the very least any such "succeed in spite of caller screwup" code should be wrapped in #ifndef DEBUG or the like.