diff options
author | David J. MacKenzie <djm@gnu.org> | 1995-11-30 20:05:01 +0000 |
---|---|---|
committer | David J. MacKenzie <djm@gnu.org> | 1995-11-30 20:05:01 +0000 |
commit | c7c5360fe5501317ce839f04a57fc1b14184191a (patch) | |
tree | 4833cf15458b5cf51c76aa63a0815d3906299b03 /src/termcap.c | |
parent | 6e2f2e921543daf459d633781c6b067738d4e458 (diff) | |
download | emacs-c7c5360fe5501317ce839f04a57fc1b14184191a.tar.gz |
(tputs): Don't let ospeed overrun the speeds array.
Diffstat (limited to 'src/termcap.c')
-rw-r--r-- | src/termcap.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) |