From: Christoph Hellwig <hch@infradead.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs_io: don't assign cvtnum() return to unsigned var
Date: Thu, 3 Dec 2009 11:58:44 -0500 [thread overview]
Message-ID: <20091203165844.GA6894@infradead.org> (raw)
In-Reply-To: <4B16AFCA.5040302@sandeen.net>
On Wed, Dec 02, 2009 at 12:19:54PM -0600, Eric Sandeen wrote:
> cvtnum() returns -1LL for unparseable values, but if we
> assign to a signed var, we can't test it:
>
> xfs_io> mincore 0 xxx
> range (0:0) is beyond mapping (0:1048576)
>
> Use a temporary signed var so we can detect the error:
>
> xfs_io> mincore 0 xxx
> non-numeric length argument -- xxx
>
> and also test whether it may overflow a size_t.
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2009-12-03 16:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 18:19 [PATCH] xfs_io: don't assign cvtnum() return to unsigned var Eric Sandeen
2009-12-02 18:26 ` [PATCH V2] " Eric Sandeen
2009-12-02 19:06 ` [PATCH V3] " Eric Sandeen
2009-12-03 16:59 ` Christoph Hellwig
2009-12-03 16:58 ` Christoph Hellwig [this message]
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=20091203165844.GA6894@infradead.org \
--to=hch@infradead.org \
--cc=sandeen@sandeen.net \
--cc=xfs@oss.sgi.com \
/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