From: "Morten Welinder" <mwelinder@gmail.com>
To: "Jim Meyering" <jim@meyering.net>
Cc: "Junio C Hamano" <junkio@cox.net>, git@vger.kernel.org
Subject: Re: avoid atoi, when possible; int overflow -> heap corruption
Date: Mon, 22 May 2006 09:16:50 -0400 [thread overview]
Message-ID: <118833cc0605220616t75a182b1oa404d5efe8a1f5d9@mail.gmail.com> (raw)
In-Reply-To: <871wumim28.fsf_-_@rho.meyering.net>
> There are about 20 uses of atoi, and most calls can return
> a usable result in spite of an invalid input -- just because
> atoi returns the same thing for "99" as "99-and-any-suffix".
> It would be better not to ignore invalid inputs.
atoi has undefined behaviour for "99-and-any-suffix". You might
get lucky and get back 99, but you might also get a random value
or a core dump.
Morten
next prev parent reply other threads:[~2006-05-22 13:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-20 22:13 synchronizing incremental git changes to cvs Jim Meyering
2006-05-20 23:05 ` Johannes Schindelin
2006-05-21 13:40 ` Jim Meyering
2006-05-22 16:29 ` Pavel Roskin
2006-05-22 17:05 ` Jakub Narebski
2006-05-21 0:09 ` Martin Langhoff
2006-05-21 16:37 ` Jim Meyering
2006-05-21 18:21 ` Junio C Hamano
2006-05-21 21:31 ` Jim Meyering
2006-05-21 21:35 ` don't accept bogus N in `HEAD~N' Jim Meyering
2006-05-21 21:42 ` Jakub Narebski
2006-05-22 7:38 ` Jim Meyering
2006-05-22 8:16 ` Junio C Hamano
2006-05-22 8:25 ` Junio C Hamano
2006-05-22 6:57 ` avoid atoi, when possible; int overflow -> heap corruption Jim Meyering
2006-05-22 13:16 ` Morten Welinder [this message]
2006-05-22 13:31 ` Jim Meyering
2006-05-22 13:37 ` Jeff King
2006-05-22 13:54 ` Morten Welinder
2006-05-22 10:27 ` detect write failure, even for stdout Jim Meyering
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=118833cc0605220616t75a182b1oa404d5efe8a1f5d9@mail.gmail.com \
--to=mwelinder@gmail.com \
--cc=git@vger.kernel.org \
--cc=jim@meyering.net \
--cc=junkio@cox.net \
/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).