From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6D7A842EF5C for ; Fri, 19 Jun 2020 02:14:24 +0300 (MSK) References: <20200617220335.836265-1-gorcunov@gmail.com> <20200617220335.836265-5-gorcunov@gmail.com> From: Vladislav Shpilevoy Message-ID: Date: Fri, 19 Jun 2020 01:14:22 +0200 MIME-Version: 1.0 In-Reply-To: <20200617220335.836265-5-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 4/6] xlog: use PATH_MAX for filename List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov , tml Cc: Alexander Turenko Hi! Thanks for the patch! > diff --git a/src/box/xlog.c b/src/box/xlog.c > index 8b2818326..1685a4cf7 100644 > --- a/src/box/xlog.c > +++ b/src/box/xlog.c > @@ -881,7 +881,9 @@ xlog_open(struct xlog *xlog, const char *name, const struct xlog_opts *opts) > if (xlog_init(xlog, opts) != 0) > goto err; > > - strncpy(xlog->filename, name, PATH_MAX); > + strncpy(xlog->filename, name, sizeof(xlog->filename)); > + xlog->filename[sizeof(xlog->filename)-1] = '\0'; Please, use whitespaces before and after binary operations.