From 2186e1583d9d65d0e79d05ec706f1e12b97bb035 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Sun, 20 Oct 2013 22:15:35 -0700 Subject: When src->src is null this doesn't get initialized but it is still used, so the passed in *ze will point to unitialized memory. Hopefully src->src is never null, but just in case this initialization doesn't hurt. --- ext/zip/lib/zip_source_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/zip/lib/zip_source_error.c') diff --git a/ext/zip/lib/zip_source_error.c b/ext/zip/lib/zip_source_error.c index ffb4652d33..70ec8bc5d4 100644 --- a/ext/zip/lib/zip_source_error.c +++ b/ext/zip/lib/zip_source_error.c @@ -40,7 +40,7 @@ ZIP_EXTERN(void) zip_source_error(struct zip_source *src, int *ze, int *se) { - int e[2]; + int e[2] = { 0, 0 }; if (src->src == NULL) { } -- cgit v1.2.1 From 5dc37b351085a7b8cdc30ef2ebb349c8e5df4e2c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 4 Nov 2013 13:23:36 +0100 Subject: Sync ext/zip with pecl/zip version 1.3.2 - update libzip to version 1.11.1. We don't use any private symbol anymore - new method ZipArchive::setPassword($password) - add --with-libzip option to build with system libzip --- ext/zip/lib/zip_source_error.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'ext/zip/lib/zip_source_error.c') diff --git a/ext/zip/lib/zip_source_error.c b/ext/zip/lib/zip_source_error.c index 70ec8bc5d4..a1efd551ea 100644 --- a/ext/zip/lib/zip_source_error.c +++ b/ext/zip/lib/zip_source_error.c @@ -1,6 +1,6 @@ /* zip_source_error.c -- get last error from zip_source - Copyright (C) 2009 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2013 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -37,24 +37,21 @@ -ZIP_EXTERN(void) +void zip_source_error(struct zip_source *src, int *ze, int *se) { - int e[2] = { 0, 0 }; + int e[2]; if (src->src == NULL) { + if (src->cb.f(src->ud, e, sizeof(e), ZIP_SOURCE_ERROR) < 0) { + e[0] = ZIP_ER_INTERNAL; + e[1] = 0; + } } else { switch (src->error_source) { case ZIP_LES_NONE: - if (src->src == NULL) { - if (src->cb.f(src->ud, e, sizeof(e), ZIP_SOURCE_ERROR) < 0) { - e[0] = ZIP_ER_INTERNAL; - e[1] = 0; - } - } - else - e[0] = e[1] = 0; + e[0] = e[1] = 0; break; case ZIP_LES_INVAL: @@ -67,8 +64,7 @@ zip_source_error(struct zip_source *src, int *ze, int *se) return; case ZIP_LES_UPPER: - if (src->cb.l(src->src, src->ud, e, sizeof(e), - ZIP_SOURCE_ERROR) < 0) { + if (src->cb.l(src->src, src->ud, e, sizeof(e), ZIP_SOURCE_ERROR) < 0) { e[0] = ZIP_ER_INTERNAL; e[1] = 0; } @@ -77,6 +73,7 @@ zip_source_error(struct zip_source *src, int *ze, int *se) default: e[0] = ZIP_ER_INTERNAL; e[1] = 0; + break; } } -- cgit v1.2.1 From c081ce628f0d76d44784d7bb8e06428b06142ac0 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 3 Jan 2014 11:08:10 +0800 Subject: Bump year --- ext/zip/lib/zip_source_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/zip/lib/zip_source_error.c') diff --git a/ext/zip/lib/zip_source_error.c b/ext/zip/lib/zip_source_error.c index a1efd551ea..f6f802c85b 100644 --- a/ext/zip/lib/zip_source_error.c +++ b/ext/zip/lib/zip_source_error.c @@ -1,6 +1,6 @@ /* zip_source_error.c -- get last error from zip_source - Copyright (C) 2009-2013 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2014 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at -- cgit v1.2.1