Fix a potential buffer overflow.
This commit is contained in:
parent
e00fa3dbaf
commit
364df6baaa
1 changed files with 1 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue