diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2013-03-14 18:11:34 +0800 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2013-03-14 18:11:34 +0800 |
commit | ce6e9471b02499cdef50832e574c8f5c838a7c00 (patch) | |
tree | 984d4617e1b68e3cae7fdc541b2adfb5d79b1fc1 /ports-mgmt | |
parent | e78f7fb401fd5c8eb6d306a74ecf52068c56160d (diff) | |
download | freebsd-ports-gnome-ce6e9471b02499cdef50832e574c8f5c838a7c00.tar.gz freebsd-ports-gnome-ce6e9471b02499cdef50832e574c8f5c838a7c00.tar.zst freebsd-ports-gnome-ce6e9471b02499cdef50832e574c8f5c838a7c00.zip |
- 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 <alexandre.perrin@netoxygen.ch>
Obtained from: upstream git
With hat: portmgr
Diffstat (limited to 'ports-mgmt')
-rw-r--r-- | ports-mgmt/pkg/Makefile | 1 | ||||
-rw-r--r-- | ports-mgmt/pkg/files/patch-libpkg__pkgdb.c | 28 | ||||
-rw-r--r-- | ports-mgmt/pkg/files/patch-newvers.sh | 19 |
3 files changed, 48 insertions, 0 deletions
diff --git a/ports-mgmt/pkg/Makefile b/ports-mgmt/pkg/Makefile index e053a1fc4892..0708bf8fb72e 100644 --- a/ports-mgmt/pkg/Makefile +++ b/ports-mgmt/pkg/Makefile @@ -2,6 +2,7 @@ PORTNAME= pkg DISTVERSION= 1.0.9 +PORTREVISION= 1 CATEGORIES= ports-mgmt MASTER_SITES= LOCAL/portmgr \ http://files.etoilebsd.net/pkg/ diff --git a/ports-mgmt/pkg/files/patch-libpkg__pkgdb.c b/ports-mgmt/pkg/files/patch-libpkg__pkgdb.c new file mode 100644 index 000000000000..293338866b14 --- /dev/null +++ b/ports-mgmt/pkg/files/patch-libpkg__pkgdb.c @@ -0,0 +1,28 @@ +commit 6bf8c2d025e30e5635e6648f35ff8dcbc7c4709c +Author: Alexandre Perrin <alexandre.perrin@netoxygen.ch> +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; diff --git a/ports-mgmt/pkg/files/patch-newvers.sh b/ports-mgmt/pkg/files/patch-newvers.sh new file mode 100644 index 000000000000..d0366a9f9b9c --- /dev/null +++ b/ports-mgmt/pkg/files/patch-newvers.sh @@ -0,0 +1,19 @@ +commit de8b5d86da60b0e25fddf5c69a60b6905ab941c4 +Author: Bryan Drewery <bryan@shatow.net> +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:=} + + # ------------------------------------------------------------------ |