From: david Date: Sun, 2 Mar 2003 16:37:48 +0000 (+0000) Subject: Patch from Frederic Bouvier: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=648f1208f83e26ba3ac225a46a61c747e101f29d;p=flightgear.git Patch from Frederic Bouvier: arrays of insufficient size are allocated in prop_picker.cxx ( size() don't count the null char ) and strcpy is writing outside the allocated array. A patch follow. --- diff --git a/src/GUI/prop_picker.cxx b/src/GUI/prop_picker.cxx index aed464a4d..445128d34 100755 --- a/src/GUI/prop_picker.cxx +++ b/src/GUI/prop_picker.cxx @@ -445,11 +445,11 @@ void fgPropPicker::find_props () files = new char* [ num_files+1 ] ; stdString line = "."; - files [ 0 ] = new char[line.size()]; + files [ 0 ] = new char[line.size() + 1]; strcpy ( files [ 0 ], line.c_str() ); line = ".."; - files [ 1 ] = new char[line.size()]; + files [ 1 ] = new char[line.size() + 1]; strcpy ( files [ 1 ], line.c_str() ); pi = 2;