From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 16:46:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 26CA6D5; Wed, 21 Aug 2013 16:46:07 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1494E28E4; Wed, 21 Aug 2013 16:46:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LGk6LH051216; Wed, 21 Aug 2013 16:46:06 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LGk6eV051215; Wed, 21 Aug 2013 16:46:06 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201308211646.r7LGk6eV051215@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 21 Aug 2013 16:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254600 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 16:46:07 -0000 Author: pluknet Date: Wed Aug 21 16:46:06 2013 New Revision: 254600 URL: http://svnweb.freebsd.org/changeset/base/254600 Log: Check strtoumax(3) for ERANGE in case of non-prefixed string. OK'd by: silence on current@ MFC after: 1 week Modified: head/lib/libutil/expand_number.c Modified: head/lib/libutil/expand_number.c ============================================================================== --- head/lib/libutil/expand_number.c Wed Aug 21 15:31:43 2013 (r254599) +++ head/lib/libutil/expand_number.c Wed Aug 21 16:46:06 2013 (r254600) @@ -55,6 +55,10 @@ expand_number(const char *buf, uint64_t number = strtoumax(buf, &endptr, 0); + if (number == UINTMAX_MAX && errno == ERANGE) { + return (-1); + } + if (endptr == buf) { /* No valid digits. */ errno = EINVAL;