diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-26 20:41:56 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-26 20:41:56 +0000 |
commit | 6b4dba46dd554999806ae4409eeae7190c0f6b68 (patch) | |
tree | 823d8ee3c5f4c7cdbb4d46bb3f413f4c7fff2be1 | |
parent | 31f1ba425870891e642182b728447f9a0fd4ecb3 (diff) |
Fix for PR1643; constrain indices into "table" to be < table_size
so we don't go off and return random, unallocated bits.
-rw-r--r-- | usr.bin/less/position.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/less/position.c b/usr.bin/less/position.c index 7778d0867a1..dcf1eb49c8b 100644 --- a/usr.bin/less/position.c +++ b/usr.bin/less/position.c @@ -56,6 +56,9 @@ extern int sc_width, sc_height; position(where) int where; { + if (where >= table_size) + where = BOTTOM; + switch (where) { case BOTTOM: |