From 3e663e8addf7f8ba6c49791264120e9389cf320f Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Tue, 9 Jan 2024 12:17:11 -0800 Subject: [PATCH] Fix format security error in rgbdx_sync.cpp (#1096) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a regression in Noetic. All the `rtabmap_ros` binary jobs in Noetic are failing with the following error: ``` 18:59:28 /opt/ros/noetic/include/ros/console.h:351:176: error: format not a string literal and no format arguments [-Werror=format-security] ... 18:59:28 /tmp/binarydeb/ros-noetic-rtabmap-sync-0.21.3/src/nodelets/rgbdx_sync.cpp:167:3: note: in expansion of macro ‘NODELET_INFO’ 18:59:28 167 | NODELET_INFO(subscribedTopicsMsg.c_str()); 18:59:28 | ^~~~~~~~~~~~ ``` https://build.ros.org/job/Nbin_uF64__rtabmap_sync__ubuntu_focal_amd64__binary/6 --- rtabmap_sync/src/nodelets/rgbdx_sync.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtabmap_sync/src/nodelets/rgbdx_sync.cpp b/rtabmap_sync/src/nodelets/rgbdx_sync.cpp index 0390716ac..f68c56b3e 100644 --- a/rtabmap_sync/src/nodelets/rgbdx_sync.cpp +++ b/rtabmap_sync/src/nodelets/rgbdx_sync.cpp @@ -164,7 +164,7 @@ class RGBDXSync : public nodelet::Nodelet std::string subscribedTopicsMsg = uFormat("%s%s", subscribedTopicsMsg_.c_str(), approxSync&&approxSyncMaxInterval!=0.0?uFormat(" (approx sync max interval=%fs)", approxSyncMaxInterval).c_str():""); - NODELET_INFO(subscribedTopicsMsg.c_str()); + NODELET_INFO("%s", subscribedTopicsMsg.c_str()); // Setup diagnostic syncDiagnostic_.reset(new SyncDiagnostic(nh, pnh, getName()));