summaryrefslogtreecommitdiff
path: root/ext/zip/lib/zip_memdup.c
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2013-11-04 13:23:36 +0100
committerRemi Collet <remi@php.net>2013-11-04 13:23:36 +0100
commit5dc37b351085a7b8cdc30ef2ebb349c8e5df4e2c (patch)
tree33357220b91d8553c0978e6392385e0fb8e49028 /ext/zip/lib/zip_memdup.c
parent2f555b8e606b5f09d635cef4d3fcbcd6939adae2 (diff)
downloadphp-git-5dc37b351085a7b8cdc30ef2ebb349c8e5df4e2c.tar.gz
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
Diffstat (limited to 'ext/zip/lib/zip_memdup.c')
-rw-r--r--ext/zip/lib/zip_memdup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/zip/lib/zip_memdup.c b/ext/zip/lib/zip_memdup.c
index 641125ed2d..06af2dabd3 100644
--- a/ext/zip/lib/zip_memdup.c
+++ b/ext/zip/lib/zip_memdup.c
@@ -1,6 +1,6 @@
/*
zip_memdup.c -- internal zip function, "strdup" with len
- Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999-2012 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <libzip@nih.at>
@@ -43,6 +43,9 @@ _zip_memdup(const void *mem, size_t len, struct zip_error *error)
{
void *ret;
+ if (len == 0)
+ return NULL;
+
ret = malloc(len);
if (!ret) {
_zip_error_set(error, ZIP_ER_MEMORY, 0);