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 | fc0a4f41db976adc84ffe4b61ae5547d6899267c (patch) | |
tree | e7be2b477a53febe7217082ab93dc851db774286 /src/termcap.c | |
parent | 0640db58fc62642f219dd6264ac35f1b09d0b0e0 (diff) | |
download | emacs-fc0a4f41db976adc84ffe4b61ae5547d6899267c.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) |