[llvm-commits] [llvm-gcc-4.2] r54327 - in /llvm-gcc-4.2/trunk/libcpp: ChangeLog.apple charset.c

Bill Wendling isanbard at gmail.com
Wed Aug 6 13:52:42 PDT 2008


On Wed, Aug 6, 2008 at 1:43 PM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Bill,
>
>> Make sure we don't read before the buffer.
>
> did you come to a conclusion about whether
>  *st_size = to.len;
> (a few lines later) is correct, or whether
> it should be
>  *st_size = to.len + 1;
> (since an extra character was appended to
> the buffer)?
>
I checked with the guy here at the office who knows this stuff (Mike
Stump). Here's his response:

"Can't imagine why that would be good.  If one has 20 characters
before, they tend to have 20 characters after... They have a testcase
that shows improved behavior?"

I'm not sure exactly what to do in this situation, or what the code
expects down the line. If the code has been there for awhile, I would
err on the side of caution and just keep it like it is. What do you
think?

-bw



More information about the llvm-commits mailing list