|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-06-23 12:39 UTC] iliaa@php.net
[2009-06-23 12:44 UTC] pajoye@php.net
[2009-06-23 13:52 UTC] pajoye@php.net
[2009-06-23 23:24 UTC] guenter@php.net
[2009-08-26 02:16 UTC] svn@php.net
[2009-08-26 02:17 UTC] guenter@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 20:00:02 2025 UTC |
Description: ------------ compilation breaks in php_zip.c function php_zip_realpath_r() because of wrong ifdefs for NetWare which leads to a missing brace. Although its sufficient to remove the code lines 157-161 I strongly suggest to cleanup the function code since the rest of ifdefs is very confusing. Please apply the patch below to a copy of php_zip.c and compare the result against the current code to verify the patch -- reading the diff properly might be _very_ confusing! --- php_zip.c.orig Thu Feb 05 20:53:22 2009 +++ php_zip.c Fri Mar 27 10:31:02 2009 @@ -148,51 +148,28 @@ } return j; } - - path[len] = 0; -#ifdef PHP_WIN32 - tmp = tsrm_do_alloca(len+1); - memcpy(tmp, path, len+1); -#elif defined(NETWARE) + path[len] = 0; tmp = tsrm_do_alloca(len+1); memcpy(tmp, path, len+1); -#else - tmp = tsrm_do_alloca(len+1); - memcpy(tmp, path, len+1); - { -#endif - if (i - 1 <= start) { - j = start; - } else { - /* some leading directories may be unaccessable */ - j = php_zip_realpath_r(path, start, i-1, ll, t, use_realpath, 1, NULL TSRMLS_CC); - if (j > start) { - path[j++] = DEFAULT_SLASH; - } + if (i - 1 <= start) { + j = start; + } else { + /* some leading directories may be unaccessable */ + j = php_zip_realpath_r(path, start, i-1, ll, t, use_realpath, 1, NULL TSRMLS_CC); + if (j > start) { + path[j++] = DEFAULT_SLASH; } -#ifdef PHP_WIN32 - if (j < 0 || j + len - i >= MAXPATHLEN-1) { - tsrm_free_alloca(tmp); - - return -1; - } - { - /* use the original file or directory name as it wasn't found */ - memcpy(path+j, tmp+i, len-i+1); - j += (len-i); - } -#else - if (j < 0 || j + len - i >= MAXPATHLEN-1) { - tsrm_free_alloca(tmp); - return -1; - } - memcpy(path+j, tmp+i, len-i+1); - j += (len-i); } -#endif + if (j < 0 || j + len - i >= MAXPATHLEN-1) { + tsrm_free_alloca(tmp); + return -1; + } + /* use the original file or directory name as it wasn't found */ + memcpy(path+j, tmp+i, len-i+1); + j += (len-i); tsrm_free_alloca(tmp); return j;