bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sharutils 4.5: Fix memory corruption with "shar ."


From: Bruce Korb
Subject: Re: sharutils 4.5: Fix memory corruption with "shar ."
Date: Wed, 10 Aug 2005 17:35:39 -0700
User-agent: KMail/1.7.1

Hi Andreas,

On Wednesday 10 August 2005 03:32 pm, Andreas Schwab wrote:
> Bruce Korb <address@hidden> writes:
> 
> > Anyway, it's seems unclear how this writes past allocated memory,
> > assuming that "restore_name_length" must be >= 2 before reaching
> 
> This assumption is wrong: strlen(".") == 1.

That's what I get for not having code handy.  I'm at home now looking
at it.  The code spends too much time trying to avoid an extra byte of
string space.  I'll start it with an extra 32 bytes so that it both
won't hit the problem and also won't need to realloc most of the time.
But also passing down ptr+2 is better than copying around strings
anyway, so I'll do both.

> > (The code is not in front of me.)  Also, what is "walkdown" going
> > to do with an empty string?
> 
> Which empty string?

The empty string that doesn't actually happen.  Didn't have the code.

Thank you for your help.

Regards, Bruce




reply via email to

[Prev in Thread] Current Thread [Next in Thread]