aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1998-02-18 22:56:25 +0000
committerKarl Heuer1998-02-18 22:56:25 +0000
commitf55a1d81284cb50289f2b96d2c8259fcc8e92c32 (patch)
tree5c960b6991cee17e69029425515cce20096849ee /src
parent588d2fd5ff44ebc2221ebbef0df8dd7f5f8ed7b2 (diff)
downloademacs-f55a1d81284cb50289f2b96d2c8259fcc8e92c32.tar.gz
emacs-f55a1d81284cb50289f2b96d2c8259fcc8e92c32.zip
(Fchar_before): Check POS in valid range
before calling CHAR_TO_BYTE.
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/editfns.c b/src/editfns.c
index bb805419293..3ad14164a8f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -589,6 +589,8 @@ is returned as a character.")
589 pos_byte = PT_BYTE; 589 pos_byte = PT_BYTE;
590 else if (MARKERP (pos)) 590 else if (MARKERP (pos))
591 pos_byte = marker_byte_position (pos); 591 pos_byte = marker_byte_position (pos);
592 else if (pos <= BEGV || pos > ZV)
593 return Qnil;
592 else 594 else
593 { 595 {
594 CHECK_NUMBER_COERCE_MARKER (pos, 0); 596 CHECK_NUMBER_COERCE_MARKER (pos, 0);
@@ -596,9 +598,6 @@ is returned as a character.")
596 pos_byte = CHAR_TO_BYTE (XINT (pos)); 598 pos_byte = CHAR_TO_BYTE (XINT (pos));
597 } 599 }
598 600
599 if (pos_byte <= BEGV_BYTE || pos_byte > ZV_BYTE)
600 return Qnil;
601
602 if (!NILP (current_buffer->enable_multibyte_characters)) 601 if (!NILP (current_buffer->enable_multibyte_characters))
603 { 602 {
604 DEC_POS (pos_byte); 603 DEC_POS (pos_byte);