sesser Fri May 28 09:38:07 2004 EDT
Modified files:
/php-src/ext/standard http_fopen_wrapper.c
Log:
Fixed off-by-one in http_fopen_wrapper
http://cvs.php.net/diff.php/php-src/ext/standard/http_fopen_wrapper.c?r1=1.87&r2=1.88&ty=u
Index: php-src/ext/standard/http_fopen_wrapper.c
diff -u php-src/ext/standard/http_fopen_wrapper.c:1.87
php-src/ext/standard/http_fopen_wrapper.c:1.88
--- php-src/ext/standard/http_fopen_wrapper.c:1.87 Thu Apr 22 23:37:20 2004
+++ php-src/ext/standard/http_fopen_wrapper.c Fri May 28 09:38:06 2004
@@ -18,7 +18,7 @@
| Wez Furlong <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: http_fopen_wrapper.c,v 1.87 2004/04/23 03:37:20 pollita Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.88 2004/05/28 13:38:06 sesser Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -498,7 +498,12 @@
char *s = strrchr(resource->path, '/');
if (!s) {
s = resource->path;
- *s = '/';
+ if (!s[0]) {
+ efree(s);
+ s = resource->path =
estrdup("/");
+ } else {
+ *s = '/';
+ }
}
s[1] = '\0';
if (resource->path &&
*(resource->path) == '/' && *(resource->path + 1) == '\0') {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php