From c1f19c838182c7f1d1e7abe49f4ddd28744d3074 Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Thu, 21 Jul 2022 12:38:33 +0000 Subject: [PATCH] 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 --- src/rgw/rgw_lua_background.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"); -- 2.39.5