From cd7a01c34fc4304ef8161ee617568f274ace5d24 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 18 Mar 2018 23:13:40 +0100 Subject: Windows: Update libzip to version 1.5.0 that include fixes for some security issues. --- src/Common/libzip/zip_name_locate.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/Common/libzip/zip_name_locate.c') diff --git a/src/Common/libzip/zip_name_locate.c b/src/Common/libzip/zip_name_locate.c index 706093f1..6713cabe 100644 --- a/src/Common/libzip/zip_name_locate.c +++ b/src/Common/libzip/zip_name_locate.c @@ -17,7 +17,7 @@ 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -41,15 +41,13 @@ ZIP_EXTERN zip_int64_t -zip_name_locate(zip_t *za, const char *fname, zip_flags_t flags) -{ +zip_name_locate(zip_t *za, const char *fname, zip_flags_t flags) { return _zip_name_locate(za, fname, flags, &za->error); } zip_int64_t -_zip_name_locate(zip_t *za, const char *fname, zip_flags_t flags, zip_error_t *error) -{ +_zip_name_locate(zip_t *za, const char *fname, zip_flags_t flags, zip_error_t *error) { int (*cmp)(const char *, const char *); const char *fn, *p; zip_uint64_t i; @@ -62,23 +60,23 @@ _zip_name_locate(zip_t *za, const char *fname, zip_flags_t flags, zip_error_t *e return -1; } - if (flags & (ZIP_FL_NOCASE|ZIP_FL_NODIR|ZIP_FL_ENC_CP437)) { + if (flags & (ZIP_FL_NOCASE | ZIP_FL_NODIR | ZIP_FL_ENC_CP437)) { /* can't use hash table */ cmp = (flags & ZIP_FL_NOCASE) ? strcasecmp : strcmp; - for (i=0; inentry; i++) { + for (i = 0; i < za->nentry; i++) { fn = _zip_get_name(za, i, flags, error); - + /* newly added (partially filled) entry or error */ if (fn == NULL) continue; - + if (flags & ZIP_FL_NODIR) { p = strrchr(fn, '/'); if (p) - fn = p+1; + fn = p + 1; } - + if (cmp(fname, fn) == 0) { _zip_error_clear(error); return (zip_int64_t)i; -- cgit v1.2.3