From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <tarantool-patches-bounces@dev.tarantool.org>
Received: from [87.239.111.99] (localhost [127.0.0.1])
	by dev.tarantool.org (Postfix) with ESMTP id 840576EC55;
	Wed, 28 Jul 2021 00:39:41 +0300 (MSK)
DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 840576EC55
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev;
	t=1627421981; bh=awOd4sdnugnp/fZ/QZdSw2yBE2AA0FHVWysrZ5k1yDI=;
	h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=QTqqXtb1+A+5EnLdxOQ/DNlkOMnrjYOR3R3hEOIBRrP4P6B5r5XdTvqBBh4Ubpt+c
	 l/szB5EDvg056fAzCDAEU5DiWZv4fKVkRfs8TfDexBdmpcd5Jh2tQ4hWmBDm9GxJ4Z
	 PtWX5/o9DgR6EVcQindAlmFyihSF4hJCOiC5E57M=
Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com
 [209.85.167.52])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by dev.tarantool.org (Postfix) with ESMTPS id AD4776EC55
 for <tarantool-patches@dev.tarantool.org>;
 Wed, 28 Jul 2021 00:39:39 +0300 (MSK)
DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AD4776EC55
Received: by mail-lf1-f52.google.com with SMTP id a26so24176241lfr.11
 for <tarantool-patches@dev.tarantool.org>;
 Tue, 27 Jul 2021 14:39:39 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=CB8Y67yyHZLoFtTX3V2htz4T/31H66h+03HBbaASJwA=;
 b=lUZu2BYXD/pVJ22i00EEhVBA8O3U5LFQ+eKEKt6TvAx2YZdv739+kDPIkwiXjuChap
 9pZdJBMDzlE3PbWsrCRFFwmYvsBqptoSPp1dJKVnZC/kDVYxLF+QP5PiIxYSP7Aas7fi
 nz+EGdGVo72R3OY4RGX0dEq6hdK7EEPLO/Tgs6oEp25uK4pu+tIHvVyXhmXTnJLFY95B
 Zf2ffRAyes4nPJHcCnFcposGzjUW/dLNPV1x+FUqGRyeISKTnWhZ1wq5cs/GoFw15B7S
 3hhlD8b5K8cle74Ubn1yxfOgvZALnFhPnntO1rG0orMHLpNbMUGW5GeIP/0jm5ooGV7d
 mIKQ==
X-Gm-Message-State: AOAM530c2taOmF4bdTDUnbA5QVqBnlXACBXpeptFsvgrNvwSW8V7e92p
 7eJeAzOu709prvYgq+L5qSnsJQ3/ZNM=
X-Google-Smtp-Source: ABdhPJzJIyvc7b43BLqQJCDJmcNhc0oOCL63/6xLIudB2UPUqBY8zh8YP8IM3S/9/WQ6oBv6yCdlDg==
X-Received: by 2002:ac2:4189:: with SMTP id z9mr17878545lfh.516.1627421978602; 
 Tue, 27 Jul 2021 14:39:38 -0700 (PDT)
Received: from grain.localdomain ([5.18.255.97])
 by smtp.gmail.com with ESMTPSA id q6sm395727lfr.239.2021.07.27.14.39.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Jul 2021 14:39:37 -0700 (PDT)
Received: by grain.localdomain (Postfix, from userid 1000)
 id D6DC65A001E; Wed, 28 Jul 2021 00:39:36 +0300 (MSK)
Date: Wed, 28 Jul 2021 00:39:36 +0300
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Message-ID: <YQB9GBAs5O/Vcp8b@grain>
References: <cover.1627420835.git.v.shpilevoy@tarantool.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <cover.1627420835.git.v.shpilevoy@tarantool.org>
User-Agent: Mutt/2.0.7 (2021-05-04)
Subject: Re: [Tarantool-patches] [PATCH 0/5] Static buf in Lua, part 3
X-BeenThere: tarantool-patches@dev.tarantool.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: Tarantool development patches <tarantool-patches.dev.tarantool.org>
List-Unsubscribe: <https://lists.tarantool.org/mailman/options/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=unsubscribe>
List-Archive: <https://lists.tarantool.org/pipermail/tarantool-patches/>
List-Post: <mailto:tarantool-patches@dev.tarantool.org>
List-Help: <mailto:tarantool-patches-request@dev.tarantool.org?subject=help>
List-Subscribe: <https://lists.tarantool.org/mailman/listinfo/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=subscribe>
From: Cyrill Gorcunov via Tarantool-patches
 <tarantool-patches@dev.tarantool.org>
Reply-To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Errors-To: tarantool-patches-bounces@dev.tarantool.org
Sender: "Tarantool-patches" <tarantool-patches-bounces@dev.tarantool.org>

On Tue, Jul 27, 2021 at 11:24:10PM +0200, Vladislav Shpilevoy wrote:
> Here we go again.
> 
> I see that Lua UUID helpers have L suffix and decimal helpers do not. Have no
> idea why, but decided not to change it here since it is not related to the patch
> goal.
> 
> I validated other usages of tt_uuid_str(), decimal_str(), tt_sprintf(),
> tt_statuc_buf(), tuple_str(), mp_str() and some others - they all seem to be
> fine now. But you can never say for sure.
> 
> Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-6259-static_buf-part3
> Issue: https://github.com/tarantool/tarantool/issues/6259

As to me the helpers

inline void
tt_uuid_to_string(const struct tt_uuid *uu, char *out)
{
	snprintf(out, UUID_STR_LEN + 1,
		"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
		uu->time_low, uu->time_mid, uu->time_hi_and_version,
		uu->clock_seq_hi_and_reserved, uu->clock_seq_low, uu->node[0],
		uu->node[1], uu->node[2], uu->node[3], uu->node[4], uu->node[5]);
}

should had been banned from the begining, length of output buffer
must be explicitly passed instead, ie

	buf[UUID_STR_LEN+1];
	tt_uuid_to_string(uu, buf, sizeof(buf));

but this is obviously unrelated to the series itself just wonder who
ever came up with such api at all, since it is just a bug lurking
around waiting to zap the caller's stack.

The series is good, thanks Vlad! Ack.