Mercurial > emacs
comparison src/editfns.c @ 106780:85fd976607be
Fix bounds checking for text properties in `format' (Bug#5306).
* intervals.h, textprop.c (extend_property_ranges): Return value
and args changed. Discard properties that begin at or after the
new end (Bug#5306).
* editfns.c (Fformat): Caller changed.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 09 Jan 2010 17:32:47 -0500 |
parents | 736322971285 |
children | 4040ecb0c904 |
comparison
equal
deleted
inserted
replaced
106779:57e095b90f5b | 106780:85fd976607be |
---|---|
4175 if (info[n].intervals) | 4175 if (info[n].intervals) |
4176 { | 4176 { |
4177 len = make_number (SCHARS (args[n])); | 4177 len = make_number (SCHARS (args[n])); |
4178 new_len = make_number (info[n].end - info[n].start); | 4178 new_len = make_number (info[n].end - info[n].start); |
4179 props = text_property_list (args[n], make_number (0), len, Qnil); | 4179 props = text_property_list (args[n], make_number (0), len, Qnil); |
4180 extend_property_ranges (props, len, new_len); | 4180 props = extend_property_ranges (props, new_len); |
4181 /* If successive arguments have properites, be sure that | 4181 /* If successive arguments have properties, be sure that |
4182 the value of `composition' property be the copy. */ | 4182 the value of `composition' property be the copy. */ |
4183 if (n > 1 && info[n - 1].end) | 4183 if (n > 1 && info[n - 1].end) |
4184 make_composition_value_copy (props); | 4184 make_composition_value_copy (props); |
4185 add_text_properties_from_list (val, props, | 4185 add_text_properties_from_list (val, props, |
4186 make_number (info[n].start)); | 4186 make_number (info[n].start)); |