linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Epler <jepler@unpythonic.net>
To: Anshul Garg <aksgarg1989@gmail.com>
Cc: akpm@linux-foundation.org, levex@linux.com,
	felipe.contreras@gmail.com, linux-kernel@vger.kernel.org,
	anshul.g@samsung.com
Subject: Re: [PATCH] lib/kstrtox.c clean kstrtoll function
Date: Thu, 22 Jan 2015 11:25:02 -0600	[thread overview]
Message-ID: <20150122172501.GE40116@unpythonic.net> (raw)
In-Reply-To: <1421934850-77446-1-git-send-email-aksgarg1989@gmail.com>

On Thu, Jan 22, 2015 at 05:54:10AM -0800, Anshul Garg wrote:
> -		if ((long long)(-tmp) >= 0)
> -			return -ERANGE;
> -		*res = -tmp;
...
> +	if ((long long)tmp < 0)
> +		return -ERANGE;
> +	*res = sign * tmp;

I don't believe overflow handling is correct anymore with this patch.
Did you try with the input as the most negative possible unsigned long?

Jeff

  reply	other threads:[~2015-01-22 17:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <aksgarg1989@gmai.com>
2015-01-22 13:54 ` [PATCH] lib/kstrtox.c clean kstrtoll function Anshul Garg
2015-01-22 17:25   ` Jeff Epler [this message]
2015-01-23 13:25     ` Anshul Garg
2015-01-24 19:30       ` Jeff Epler

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=20150122172501.GE40116@unpythonic.net \
    --to=jepler@unpythonic.net \
    --cc=akpm@linux-foundation.org \
    --cc=aksgarg1989@gmail.com \
    --cc=anshul.g@samsung.com \
    --cc=felipe.contreras@gmail.com \
    --cc=levex@linux.com \
    --cc=linux-kernel@vger.kernel.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).