]> git.mxchange.org Git - flightgear.git/commitdiff
Make room for the terminatig '\0' and prevent a potential buffer overflow.
authorehofman <ehofman>
Fri, 28 Nov 2003 17:56:36 +0000 (17:56 +0000)
committerehofman <ehofman>
Fri, 28 Nov 2003 17:56:36 +0000 (17:56 +0000)
src/GUI/AirportList.cxx

index 2057e520f519a8ecfef0685c145ed227cc5acbac..73fbdd2aa6d858a147c323f82f71a3165ee96732 100644 (file)
@@ -21,7 +21,7 @@ AirportList::AirportList (int x, int y, int width, int height)
                  airport->id.c_str(),
                  airport->name.c_str());
         int str_len = strlen(buf);
-        _content[i] = new char[(str_len > 1023) ? 1024 : str_len];
+        _content[i] = new char[(str_len > 1023) ? 1024 : str_len+1];
         strncpy(_content[i], buf, 1023);
     }
     _content[_nAirports] = 0;