]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/lua: make assignment of char* to std::string explicit 47209/head
authorYuval Lifshitz <ylifshit@redhat.com>
Thu, 21 Jul 2022 12:38:33 +0000 (12:38 +0000)
committerYuval Lifshitz <ylifshit@redhat.com>
Thu, 21 Jul 2022 15:10:37 +0000 (15:10 +0000)
issue is happening on RHEL8, when using: g++ (GCC) 8.5.0

Fixes: https://tracker.ceph.com/issues/56170
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_lua_background.h

index 5d7eafa39befdb33a8ed55312f280a30724ae48d..c6051164eb4212536a3d0d945670a46ccbd46829 100644 (file)
@@ -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");