From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 64D54469719 for ; Tue, 3 Nov 2020 17:09:03 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id 2so19136754ljj.13 for ; Tue, 03 Nov 2020 06:09:03 -0800 (PST) Date: Tue, 3 Nov 2020 17:08:58 +0300 From: Cyrill Gorcunov Message-ID: <20201103140858.GI2339@grain> References: <429b3e4d-490d-ea88-946a-fc0487f9e46a@tarantool.org> <20201102131945.GB517@tarantool.org> <20201102211828.GE2339@grain> <20201102214720.GF2339@grain> <20201103135942.GD517@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201103135942.GD517@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] core: fix static_alloc buffer overflow List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy On Tue, Nov 03, 2020 at 04:59:42PM +0300, Sergey Ostanevich wrote: > Hi! > > I double checked the snprintf fails only if buf is set to NULL _and_ the > len is set to a non-zero value. > > So I would follow Vlad's proposal on factoring out the code to make it > clearer. > > Sergos. Looks ok to me.