Fix write-beyond-end-of-string error in the conversion to R6RS string escapes.
authorLudovic Courtès <ludo@gnu.org>
Wed, 15 Sep 2010 21:32:28 +0000 (23:32 +0200)
committerLudovic Courtès <ludo@gnu.org>
Wed, 15 Sep 2010 21:32:28 +0000 (23:32 +0200)
commitf1ee6d54d219056c62d87a8e4a6b199162c946e8
tree2ccec5ae9d5c772111d8b1b48569c8b751d5257a
parentfd5eec2b6e113f6d13028215a738417607432a2d
Fix write-beyond-end-of-string error in the conversion to R6RS string escapes.

Reported by Mike Gran <spk121@yahoo.com>.

* libguile/strings.c (scm_i_unistring_escapes_to_guile_escapes,
  scm_i_unistring_escapes_to_r6rs_escapes): Augment comments.
  (scm_to_stringn): When `handler ==
  SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE && SCM_R6RS_ESCAPES_P', realloc
  BUF so that it's large enough for the worst case.

* libguile/print.c (display_character): When `result != NULL && strategy
  == SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE && SCM_R6RS_ESCAPES_P', make
  LOCALE_ENCODED large enough to hold an R6RS escape.
libguile/print.c
libguile/strings.c