]> git.eshelyaron.com Git - emacs.git/commitdiff
(tputs): Don't let ospeed overrun the speeds array.
authorDavid J. MacKenzie <djm@gnu.org>
Thu, 30 Nov 1995 20:05:01 +0000 (20:05 +0000)
committerDavid J. MacKenzie <djm@gnu.org>
Thu, 30 Nov 1995 20:05:01 +0000 (20:05 +0000)
src/termcap.c

index 595fc425c181893ab9460f2cf0700e9da6c7c5a1..26a12290778fc079bc5e0d9398a65f92d7cd654f 100644 (file)
@@ -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)