From: Petr Baudis <pasky@suse.cz>
To: Erik Mouw <mouw@nl.linux.org>
Cc: git@vger.kernel.org
Subject: Re: Git string manipulation functions wrong?
Date: Mon, 21 May 2007 16:36:16 +0200 [thread overview]
Message-ID: <20070521143616.GG4489@pasky.or.cz> (raw)
In-Reply-To: <20070521131103.GN8200@gateway.home>
On Mon, May 21, 2007 at 03:11:03PM CEST, Erik Mouw wrote:
> Hi,
>
> I got this forwarded from a friend who is subscribed to the Dovecot
> mailing lists (dovecot is a pop3/imap server).
>
> http://www.dovecot.org/list/dovecot/2007-May/022853.html
> http://www.dovecot.org/list/dovecot/2007-May/022856.html
>
> The Dovecot author claims there are "basic string manipulation errors"
> in the git code and that's a reason for him not to use git.
>
> I can see his problem with *snprintf() functions in the case where the
> amount of output is larger than the buffer size: *snprintf() will
> return the number of characters written if there would have been enough
> space to write them, which will lead to problems with code like "len +=
> snprintf(buf, max, bla, ...)". I don't see his problems with strncpy(),
> though.
It's the opposite for me - we don't properly set the NUL byte for smoe
of our strncpy() calls, but I don't really see his problem with
snprintf(), we seem to handle its return value correctly everywhere
(except diff.c, but there the buffer sizes should be designed in such a
way that an overflow should be impossible).
--
Petr "Pasky the Sleepy" Baudis
Stuff: http://pasky.or.cz/
Ever try. Ever fail. No matter. // Try again. Fail again. Fail better.
-- Samuel Beckett
next prev parent reply other threads:[~2007-05-21 14:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-21 13:11 Git string manipulation functions wrong? Erik Mouw
2007-05-21 14:36 ` Petr Baudis [this message]
2007-05-21 14:59 ` Karl Hasselström
2007-05-23 3:22 ` Kyle Moffett
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070521143616.GG4489@pasky.or.cz \
--to=pasky@suse.cz \
--cc=git@vger.kernel.org \
--cc=mouw@nl.linux.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 NNTP newsgroup(s).