From owner-svn-src-head@FreeBSD.ORG Wed Jul 10 10:57:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD747593; Wed, 10 Jul 2013 10:57:09 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AFFD7136B; Wed, 10 Jul 2013 10:57:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AAv970097967; Wed, 10 Jul 2013 10:57:09 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AAv97Q097966; Wed, 10 Jul 2013 10:57:09 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201307101057.r6AAv97Q097966@svn.freebsd.org> From: David Chisnall Date: Wed, 10 Jul 2013 10:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253149 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jul 2013 10:57:09 -0000 Author: theraven Date: Wed Jul 10 10:57:09 2013 New Revision: 253149 URL: http://svnweb.freebsd.org/changeset/base/253149 Log: Report error for out-of-range numerical inputs. Requested by brooks. Modified: head/usr.bin/dtc/fdt.cc Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Wed Jul 10 10:51:12 2013 (r253148) +++ head/usr.bin/dtc/fdt.cc Wed Jul 10 10:57:09 2013 (r253149) @@ -30,6 +30,8 @@ * $FreeBSD$ */ +#define __STDC_LIMIT_MACROS 1 + #include "fdt.hh" #include @@ -281,6 +283,12 @@ property::parse_cells(input_buffer &inpu valid = false; return; } + if ((val < 0) || (val > UINT32_MAX)) + { + input.parse_error("Value out of range"); + valid = false; + return; + } push_big_endian(v.byte_data, (uint32_t)val); input.next_token(); }