From: David J. MacKenzie Date: Thu, 30 Nov 1995 20:05:01 +0000 (+0000) Subject: (tputs): Don't let ospeed overrun the speeds array. X-Git-Tag: emacs-19.34~2183 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c7c5360fe5501317ce839f04a57fc1b14184191a;p=emacs.git (tputs): Don't let ospeed overrun the speeds array. --- diff --git a/src/termcap.c b/src/termcap.c index 595fc425c18..26a12290778 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -300,8 +300,10 @@ tputs (str, nlines, outfun) #else if (ospeed == 0) speed = tputs_baud_rate; - else + else if (ospeed > 0 && ospeed < (sizeof speeds / sizeof speeds[0])) speed = speeds[ospeed]; + else + speed = 0; #endif if (!str)