Mercurial > hg > xemacs-beta
changeset 5870:df50aaeddca5
Don't tickle an unreasonable but standard C lib limitation, thank you Vin!
src/ChangeLog addition:
2015-03-17 Aidan Kehoe <kehoea@parhasard.net>
* data.c (fill_ichar_array):
Be a bit more careful never to supply the C library's isupper()
with a value outside of that range specified by the C
standard. Thank you Vin Shelton for reporting the Linux
segmentation violation this provokes, and happy St. Patrick's Day
to everyone reading the XEmacs lists!
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 17 Mar 2015 00:29:39 +0000 |
parents | 04b854934407 |
children | 58e72e27fb81 |
files | src/ChangeLog src/data.c |
diffstat | 2 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Mon Mar 16 09:03:22 2015 +0000 +++ b/src/ChangeLog Tue Mar 17 00:29:39 2015 +0000 @@ -1,3 +1,12 @@ +2015-03-17 Aidan Kehoe <kehoea@parhasard.net> + + * data.c (fill_ichar_array): + Be a bit more careful never to supply the C library's isupper() + with a value outside of that range specified by the C + standard. Thank you Vin Shelton for reporting the Linux + segmentation violation this provokes, and happy St. Patrick's Day + to everyone reading the XEmacs lists! + 2015-03-08 Aidan Kehoe <kehoea@parhasard.net> * data.c (Fparse_integer):
--- a/src/data.c Mon Mar 16 09:03:22 2015 +0000 +++ b/src/data.c Tue Mar 17 00:29:39 2015 +0000 @@ -1484,9 +1484,15 @@ } /* Maybe our own case infrastructure is not available yet. Use the C library's. */ - else if (isupper (range->ch) && !isupper (cctable[valint])) + else if (current_buffer == NULL) { - cctable[valint] = range->ch; + /* The C library can't necessarily handle values outside of + the range EOF to CHAR_MAX, inclusive. */ + assert (range->ch == EOF || range->ch <= CHAR_MAX); + if (isupper (range->ch) && !isupper (cctable[valint])) + { + cctable[valint] = range->ch; + } } /* Otherwise, save it if this character has a numerically lower value (preferring ASCII over fullwidth Chinese and so on). */