From: Yuval Lifshitz Date: Thu, 21 Jul 2022 12:38:33 +0000 (+0000) Subject: rgw/lua: make assignment of char* to std::string explicit X-Git-Tag: v18.0.0~455^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c1f19c838182c7f1d1e7abe49f4ddd28744d3074;p=ceph.git rgw/lua: make assignment of char* to std::string explicit issue is happening on RHEL8, when using: g++ (GCC) 8.5.0 Fixes: https://tracker.ceph.com/issues/56170 Signed-off-by: Yuval Lifshitz --- diff --git a/src/rgw/rgw_lua_background.h b/src/rgw/rgw_lua_background.h index 5d7eafa39befd..c6051164eb421 100644 --- a/src/rgw/rgw_lua_background.h +++ b/src/rgw/rgw_lua_background.h @@ -118,8 +118,11 @@ struct RGWTable : EmptyMetaTable { } break; case LUA_TSTRING: - value = lua_tolstring(L, 3, &len); + { + const auto str = lua_tolstring(L, 3, &len); + value = std::string{str, len}; break; + } default: l.unlock(); return luaL_error(L, "unsupported value type for RGW table");