diff options
| author | Paul Eggert | 2011-09-15 09:10:37 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-09-15 09:10:37 -0700 |
| commit | a02719a326f3bc0ddf39832ef5390f8034c24c24 (patch) | |
| tree | 04a8bb98e7206f428461cf361c632380b09f4c8b /src | |
| parent | 72589a3ceebd3b6c903963e5f82b78df004e851d (diff) | |
| download | emacs-a02719a326f3bc0ddf39832ef5390f8034c24c24.tar.gz emacs-a02719a326f3bc0ddf39832ef5390f8034c24c24.zip | |
* editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
This occurs when processing a multibyte format, which can happen
when using 'eval'. Problem reported by Wolfgang Jenker.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/editfns.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 83dc66a1720..895e3e587b3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-09-15 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514). | ||
| 4 | This occurs when processing a multibyte format, which can happen | ||
| 5 | when using 'eval'. Problem reported by Wolfgang Jenker. | ||
| 6 | |||
| 1 | 2011-09-15 Johan Bockgård <bojohan@gnu.org> | 7 | 2011-09-15 Johan Bockgård <bojohan@gnu.org> |
| 2 | 8 | ||
| 3 | * xdisp.c (try_cursor_movement): Only check for exact match if | 9 | * xdisp.c (try_cursor_movement): Only check for exact match if |
diff --git a/src/editfns.c b/src/editfns.c index 596765d899e..f62efc30790 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -4137,8 +4137,9 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 4137 | format++; | 4137 | format++; |
| 4138 | while (! CHAR_HEAD_P (*format)); | 4138 | while (! CHAR_HEAD_P (*format)); |
| 4139 | 4139 | ||
| 4140 | convbytes = format - format0; | 4140 | convbytes = format - src; |
| 4141 | memset (&discarded[format0 + 1 - format_start], 2, convbytes - 1); | 4141 | memset (&discarded[format0 + 1 - format_start], 2, |
| 4142 | format - (format0 + 1)); | ||
| 4142 | } | 4143 | } |
| 4143 | else | 4144 | else |
| 4144 | { | 4145 | { |