From: curt Date: Mon, 20 Jan 2003 03:14:43 +0000 (+0000) Subject: Fix a potential buffer overflow. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=364df6baaa671a3527abdfc53147d073982b3101;p=flightgear.git Fix a potential buffer overflow. --- 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 {