From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23087 invoked by alias); 20 May 2015 18:17:38 -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: X-Seq: 35245 Received: (qmail 2813 invoked from network); 20 May 2015 18:17:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.0 From: Kamil Dudka To: Bart Schaefer Cc: zsh-workers@zsh.org Subject: Re: [PATCH] mkenvstr: avoid crash in case NULL is given as value Date: Wed, 20 May 2015 20:17:30 +0200 Message-ID: <9615546.qODALlRzib@kdudka.brq.redhat.com> User-Agent: KMail/4.14.7 (Linux/4.0.1-300.fc22.x86_64; KDE/4.14.7; x86_64; ; ) In-Reply-To: <13142758.yMuWt9XIhO@kdudka.brq.redhat.com> References: <1432059854-2109-1-git-send-email-kdudka@redhat.com> <150520102300.ZM26712@torch.brasslantern.com> <13142758.yMuWt9XIhO@kdudka.brq.redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 On Wednesday 20 May 2015 19:35:13 Kamil Dudka wrote: > On Wednesday 20 May 2015 10:23:00 Bart Schaefer wrote: > > On May 20, 4:43pm, Kamil Dudka wrote: > > } > > } Good catch! Then your patch certainly looks as a better choice to me. > > > > It belatedly occurs to me that adding > > > > if (!value) > > > > value = ""; > > > > would have been a sufficient change. Oh, well. > > I am quite new to zsh code but this drives me to a question: Are the strings > allocated in mkenvstr() freed anywhere? Oops, it is a misleading question anyway. It would return an allocated string in both cases. Sorry for the noise. > Kamil