Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Serge Petrenko <sergepetrenko@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] box: fix long uri output in box.info()
Date: Mon, 20 Aug 2018 23:50:50 +0300	[thread overview]
Message-ID: <20180820205050.GB32353@chai> (raw)
In-Reply-To: <20180820180806.97866-1-sergepetrenko@tarantool.org>

* Serge Petrenko <sergepetrenko@tarantool.org> [18/08/20 21:24]:
> lua_pushapplier() had an inexplicably small buffer for uri
> representation. Enlarged the buffer.
> 
> Closes #3630

Hi, 

Thanks for finding this. 

But the trouble is not only with the small buffer, but also with
incorrect termination of a possibly multi-byte string in case of
truncation.

Could you please add a unit test for uri_format which fixes this?

Thanks.
> ---
> https://github.com/tarantool/tarantool/issues/3630
> https://github.com/tarantool/tarantool/tree/sp/gh-3630-long-uri-fix
> 
>  src/box/lua/info.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/box/lua/info.c b/src/box/lua/info.c
> index d6697df9c..970c80c99 100644
> --- a/src/box/lua/info.c
> +++ b/src/box/lua/info.c
> @@ -95,7 +95,7 @@ lbox_pushapplier(lua_State *L, struct applier *applier)
>  			       applier->last_row_time);
>  		lua_settable(L, -3);
>  
> -		char name[FIBER_NAME_MAX];
> +		char name[APPLIER_SOURCE_MAXLEN];
>  		int total = uri_format(name, sizeof(name), &applier->uri, false);
>  
>  		lua_pushstring(L, "peer");
> -- 
> 2.15.2 (Apple Git-101.1)
> 
> 

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

      reply	other threads:[~2018-08-20 20:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 18:08 [tarantool-patches] " Serge Petrenko
2018-08-20 20:50 ` Konstantin Osipov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180820205050.GB32353@chai \
    --to=kostja@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] box: fix long uri output in box.info()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox