unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: Optimization & factorization of ‘write’
Date: Wed, 15 Sep 2010 23:35:44 +0200	[thread overview]
Message-ID: <87pqwed70v.fsf@gnu.org> (raw)
In-Reply-To: 257144.86099.qm@web37904.mail.mud.yahoo.com

Hi,

Mike Gran <spk121@yahoo.com> writes:

>> >  But I tried it just now on HEAD, and it triggered a 'glibc detected
>> >  corrupteddouble-linked list' error.  Curious.
>> 
>> Hmm indeed.  Can  you come up with a reduced test case and perhaps a
>> backtrace or  something?
>> 
>
> in  scm_i_unistring_escapes_to_r6rs_escapes(), you can have a write
> off the end of a string when the buffer passed into the function contains
> only 4-digit hex unistring hex escapes, such as "\u1100".  The
> R6RS-escaped string will be longer "\x1100;" causing the memcpy at the
> end of the function to write off then end of the string.

Indeed, good catch!

I think commit f1ee6d54d219056c62d87a8e4a6b199162c946e8 hackily fixes
it.

The whole thing is hackish though: the conversion is inelegant, and it
assumes that BUF is in an ASCII-compatible encoding.  I think the right
way would be to have libunistring allow us to specify what we want
escapes to look like.

Thanks,
Ludo’.




      reply	other threads:[~2010-09-15 21:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-14 14:21 Optimization & factorization of ‘write’ Ludovic Courtès
2010-09-14 18:31 ` Mike Gran
2010-09-14 19:12   ` Ludovic Courtès
2010-09-14 23:04     ` Ludovic Courtès
2010-09-15  4:19     ` Mike Gran
2010-09-15 11:40       ` Ludovic Courtès
2010-09-15 14:28         ` Mike Gran
2010-09-15 21:35           ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqwed70v.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).