From: mfranz Date: Mon, 1 Jun 2009 10:32:44 +0000 (+0000) Subject: Dave LUFF: Fix buffer overrun with longer runways X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5a200cb5f4539d5af8202281083c50d1a0fd31b5;p=flightgear.git Dave LUFF: Fix buffer overrun with longer runways --- diff --git a/src/Instrumentation/dclgps.cxx b/src/Instrumentation/dclgps.cxx index 3156c55ac..9d6ccc675 100644 --- a/src/Instrumentation/dclgps.cxx +++ b/src/Instrumentation/dclgps.cxx @@ -257,9 +257,8 @@ void GPSPage::OBSPressed() {} void GPSPage::MsgPressed() {} string GPSPage::GPSitoa(int n) { - char buf[4]; - // TODO - sanity check n! - sprintf(buf, "%i", n); + char buf[6]; + snprintf(buf, 6, "%i", n); string s = buf; return(s); }