|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-08-08 18:57 UTC] smclean at gmail dot com
[2009-01-10 15:01 UTC] mikesul@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 00:00:02 2025 UTC |
Description: ------------ The following code ends up in a segmentation fault file_exists('ssh2.sftp:///home/apache'); I am not sure if this is "right", but the following 3 lines of code fixed this problem for me --- /tmp/pear/cache/ssh2-0.10/ssh2_fopen_wrappers.c 2007-08-03 17:35:34.000000000 +0200 +++ ssh2_fopen_wrappers.c 2007-08-03 18:16:06.000000000 +0200 @@ -124,6 +124,10 @@ resource = php_url_parse(path); + if (!resource) { + return NULL; + } + if (strncmp(resource->scheme, "ssh2.", sizeof("ssh2.") - 1)) { /* Not an ssh wrapper */ php_url_free(resource); Reproduce code: --------------- file_exists('ssh2.sftp:///home/apache'); Expected result: ---------------- false Actual result: -------------- Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1216297296 (LWP 1257)] 0xb566ae9c in php_ssh2_fopen_wraper_parse_path (path=0x8ef3ba8 "ssh2.sftp:///home/apache", type=0xb566e628 "sftp", context=0x0, psession=0xbfe03a08, presource_id=0xbfe03a00, psftp=0xbfe03a04, psftp_rsrcid=0xbfe039fc) at /home/u80759076/Projekte/ssh2/ssh2-0.10/ssh2_fopen_wrappers.c:129 129 if (strncmp(resource->scheme, "ssh2.", sizeof("ssh2.") - 1)) {