Skip to content

Commit 0b785fa

Browse files
author
John Zhao
committed
Avoid out-of-bounds access on global data
After enabling address sanitizer at debug build, global_buffer_overflow is observed while launching the Viewer version 2.56.5. This change is to address the out-of-bound issue. Signed-off-by: John Zhao <[email protected]>
1 parent 09cf0f6 commit 0b785fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

common/viewer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,8 @@ namespace rs2
853853
+ "99-realsense-libusb.rules";
854854

855855
std::ofstream out(tmp_filename.c_str());
856-
out << realsense_udev_rules;
856+
std::string tmp = std::string(realsense_udev_rules, sizeof(realsense_udev_rules));
857+
out << tmp;
857858
out.close();
858859
}
859860
}

0 commit comments

Comments
 (0)