Re: [PATCH 08/13] col: check with strtol_or_err option argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 24, 2011 at 10:56:39PM +0200, Sami Kerola wrote:
>  		case 'l':		/* buffered line count */
> -			if ((max_bufd_lines = atoi(optarg)) <= 0)
> -				errx(EXIT_FAILURE, _("bad -l argument %s."), optarg);
> +			tmplong = strtoul_or_err(optarg, _("bad -l argument"));
> +			if ((INT_MAX / 2) < tmplong)

 Why we need this magical (INT_MAX / 2) limit?

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux