Are you sure this is the right place to fix it? I would fix the place which calls this function because you might end up crashing on the returned null in the places which call this.

At 11:01 PM 3/26/2003 +0000, Sterling Hughes wrote:
sterling Wed Mar 26 18:01:39 2003 EDT

  Modified files:
    /php4/main  fopen_wrappers.c
  Log:
  fix segfault


Index: php4/main/fopen_wrappers.c diff -u php4/main/fopen_wrappers.c:1.159 php4/main/fopen_wrappers.c:1.160 --- php4/main/fopen_wrappers.c:1.159 Sun Feb 23 17:30:02 2003 +++ php4/main/fopen_wrappers.c Wed Mar 26 18:01:39 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */

-/* $Id: fopen_wrappers.c,v 1.159 2003/02/23 22:30:02 sniper Exp $ */
+/* $Id: fopen_wrappers.c,v 1.160 2003/03/26 23:01:39 sterling Exp $ */

 /* {{{ includes
  */
@@ -490,7 +490,13 @@
  */
 PHPAPI char *php_strip_url_passwd(char *url)
 {
-       register char *p = url, *url_start;
+       register char *p, *url_start;
+
+       if (url == NULL) {
+               return NULL;
+       }
+
+       p = url;

        while (*p) {
                if (*p==':' && *(p+1)=='/' && *(p+2)=='/') {



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to