From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 06:24:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD90BD8D; Tue, 2 Dec 2014 06:24:46 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA14A89A; Tue, 2 Dec 2014 06:24:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB26Okd3024466; Tue, 2 Dec 2014 06:24:46 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB26OksD024465; Tue, 2 Dec 2014 06:24:46 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201412020624.sB26OksD024465@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 2 Dec 2014 06:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275396 - head/lib/libgpio 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.18-1 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: Tue, 02 Dec 2014 06:24:46 -0000 Author: rpaulo Date: Tue Dec 2 06:24:45 2014 New Revision: 275396 URL: https://svnweb.freebsd.org/changeset/base/275396 Log: Fix an off-by-one in gpio_pin_list(). Coverity CID: 1256495 Modified: head/lib/libgpio/gpio.c Modified: head/lib/libgpio/gpio.c ============================================================================== --- head/lib/libgpio/gpio.c Tue Dec 2 06:11:32 2014 (r275395) +++ head/lib/libgpio/gpio.c Tue Dec 2 06:24:45 2014 (r275396) @@ -89,7 +89,7 @@ gpio_pin_list(gpio_handle_t handle, gpio errno = EINVAL; return (-1); } - cfgs = calloc(maxpins, sizeof(*cfgs)); + cfgs = calloc(maxpins + 1, sizeof(*cfgs)); if (cfgs == NULL) return (-1); for (i = 0; i <= maxpins; i++) {