From 364df6baaa671a3527abdfc53147d073982b3101 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 20 Jan 2003 03:14:43 +0000 Subject: [PATCH] Fix a potential buffer overflow. --- src/Autopilot/auto_gui.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Autopilot/auto_gui.cxx b/src/Autopilot/auto_gui.cxx index 047a75d98..1af3e5234 100644 --- a/src/Autopilot/auto_gui.cxx +++ b/src/Autopilot/auto_gui.cxx @@ -722,7 +722,7 @@ void AddWayPoint(puObject *cb) WPList = new char* [ WPListsize + 1 ]; for (i = 0; i < globals->get_route()->size(); i++ ) { sprintf(WPString, "%5s %3.2flon %3.2flat", globals->get_route()->get_waypoint(i).get_id().c_str(), globals->get_route()->get_waypoint(i).get_target_lon(), globals->get_route()->get_waypoint(i).get_target_lat()); - WPList [i] = new char[ strlen(WPString) ]; + WPList [i] = new char[ strlen(WPString)+1 ]; strcpy ( WPList [i], WPString ); } } else { -- 2.39.5