From owner-svn-ports-all@FreeBSD.ORG Thu Mar 14 10:11:35 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6AAD8171; Thu, 14 Mar 2013 10:11:35 +0000 (UTC) (envelope-from bdrewery@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 4EDE4FE2; Thu, 14 Mar 2013 10:11:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2EABZMW018981; Thu, 14 Mar 2013 10:11:35 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2EABY8Q018975; Thu, 14 Mar 2013 10:11:34 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201303141011.r2EABY8Q018975@svn.freebsd.org> From: Bryan Drewery Date: Thu, 14 Mar 2013 10:11:34 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r314143 - in head/ports-mgmt/pkg: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Mar 2013 10:11:35 -0000 Author: bdrewery Date: Thu Mar 14 10:11:34 2013 New Revision: 314143 URL: http://svnweb.freebsd.org/changeset/ports/314143 Log: - Fix crash in pkg-update You may need to manually 'pkg add' 1.0.9_1 or rebuild from ports if you are on 1.0.9 Submitted by: Alexandre Perrin Obtained from: upstream git With hat: portmgr Added: head/ports-mgmt/pkg/files/ head/ports-mgmt/pkg/files/patch-libpkg__pkgdb.c (contents, props changed) head/ports-mgmt/pkg/files/patch-newvers.sh (contents, props changed) Modified: head/ports-mgmt/pkg/Makefile Modified: head/ports-mgmt/pkg/Makefile ============================================================================== --- head/ports-mgmt/pkg/Makefile Thu Mar 14 10:11:19 2013 (r314142) +++ head/ports-mgmt/pkg/Makefile Thu Mar 14 10:11:34 2013 (r314143) @@ -2,6 +2,7 @@ PORTNAME= pkg DISTVERSION= 1.0.9 +PORTREVISION= 1 CATEGORIES= ports-mgmt MASTER_SITES= LOCAL/portmgr \ http://files.etoilebsd.net/pkg/ Added: head/ports-mgmt/pkg/files/patch-libpkg__pkgdb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg/files/patch-libpkg__pkgdb.c Thu Mar 14 10:11:34 2013 (r314143) @@ -0,0 +1,28 @@ +commit 6bf8c2d025e30e5635e6648f35ff8dcbc7c4709c +Author: Alexandre Perrin +Date: Tue Mar 5 12:04:44 2013 +0100 + + check the return value of sqlite3_column_text() against NULL in get_sql_string() + + The return value of sqlite3_column_text() was not checked and passed + directly to strdup() causing a SIGSEV from libc. This patch ensure that + a NULL returned value will not be given to strdup(). + +diff --git libpkg/pkgdb.c libpkg/pkgdb.c +index 7140a69..7a2c706 100644 +--- libpkg/pkgdb.c ++++ libpkg/pkgdb.c +@@ -2413,8 +2413,11 @@ get_sql_string(sqlite3 *s, const char *sql, char **res) + + ret = sqlite3_step(stmt); + +- if (ret == SQLITE_ROW) +- *res = strdup(sqlite3_column_text(stmt, 0)); ++ if (ret == SQLITE_ROW) { ++ const unsigned char *tmp; ++ tmp = sqlite3_column_text(stmt, 0); ++ *res = (tmp == NULL ? NULL : strdup(tmp)); ++ } + + if (ret == SQLITE_DONE) + *res = NULL; Added: head/ports-mgmt/pkg/files/patch-newvers.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg/files/patch-newvers.sh Thu Mar 14 10:11:34 2013 (r314143) @@ -0,0 +1,19 @@ +commit de8b5d86da60b0e25fddf5c69a60b6905ab941c4 +Author: Bryan Drewery +Date: Thu Mar 14 05:00:26 2013 -0500 + + Bump to 1.0.9_1 + +diff --git newvers.sh newvers.sh +index e034c10..0712689 100755 +--- newvers.sh ++++ newvers.sh +@@ -41,7 +41,7 @@ + : ${PKG_MINOR_VERSION="0"} + : ${PKG_PATCH_LEVEL="9"} + +-: ${PORTREVISION:=} ++: ${PORTREVISION:="1"} + : ${PORTEPOCH:=} + + # ------------------------------------------------------------------