Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] box: fix long uri output in box.info()
@ 2018-08-20 18:08 Serge Petrenko
  2018-08-20 20:50 ` [tarantool-patches] " Konstantin Osipov
  0 siblings, 1 reply; 2+ messages in thread
From: Serge Petrenko @ 2018-08-20 18:08 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Serge Petrenko

lua_pushapplier() had an inexplicably small buffer for uri
representation. Enlarged the buffer.

Closes #3630
---
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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tarantool-patches] Re: [PATCH] box: fix long uri output in box.info()
  2018-08-20 18:08 [tarantool-patches] [PATCH] box: fix long uri output in box.info() Serge Petrenko
@ 2018-08-20 20:50 ` Konstantin Osipov
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Osipov @ 2018-08-20 20:50 UTC (permalink / raw)
  To: tarantool-patches; +Cc: Serge Petrenko

* 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-20 20:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-20 18:08 [tarantool-patches] [PATCH] box: fix long uri output in box.info() Serge Petrenko
2018-08-20 20:50 ` [tarantool-patches] " Konstantin Osipov

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