Skip to content

Commit

Permalink
A fix to a critical stack buffer overflow vulnerability which leads t…
Browse files Browse the repository at this point in the history
…o direct control flow hijacking (ros#1092)

* A fix to a critical stack buffer overflow vulnerability which leads to control flow hi-jacking.

* Much more simple fix for the stack overflow bug
  • Loading branch information
dingelish authored and sputnick1124 committed Jul 30, 2017
1 parent 3c11f47 commit 6b705b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/rosbag_storage/src/bag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void Bag::readVersion() {
#if defined(_MSC_VER)
if (sscanf_s(version_line.c_str(), "#ROS%s V%d.%d", logtypename, sizeof(logtypename), &version_major, &version_minor) != 3)
#else
if (sscanf(version_line.c_str(), "#ROS%s V%d.%d", logtypename, &version_major, &version_minor) != 3)
if (sscanf(version_line.c_str(), "#ROS%99s V%d.%d", logtypename, &version_major, &version_minor) != 3)
#endif
throw BagIOException("Error reading version line");

Expand Down

0 comments on commit 6b705b3

Please sign in to comment.