[Box Backup-dev] COMMIT r302 - in box/trunk: lib/backupclient test/bbackupd
Ben Summers
boxbackup-dev@fluffy.co.uk
Sat, 7 Jan 2006 08:27:38 +0000
On 7 Jan 2006, at 00:07, Martin Ebourne wrote:
> On Fri, 2006-01-06 at 20:45 +0000, Ben Summers wrote:
>>> - A very unlikely failure where getxattr returns an error code the
>>> first time
>>> but succeeds the second time could cause buffer overrun and
>>> corruption.
>>
>> Would it really? While the error check is desirable, I don't see how
>> it could, given that the size of the buffer is passed to lgetxattr().
>
> Of course, you're right. So the worst that could happen is an
> attribute
> value would get lost on certain platforms. Still, as you say, it's
> good
> practice to always catch error codes, especially in a backup
> program. :)
That's a relief. I'm very careful about buffer overflows and the
like, and it would have been embarrassing to have written dodgy code
in such a simple case.
Ben