Skip to content

Commit b9d3aaf

Browse files
author
Stefan Esser
committed
MFH
1 parent 7966bb1 commit b9d3aaf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/standard/http_fopen_wrapper.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,12 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
467467
char *s = strrchr(resource->path, '/');
468468
if (!s) {
469469
s = resource->path;
470-
*s = '/';
470+
if (!s[0]) {
471+
efree(s);
472+
s = resource->path = estrdup("/");
473+
} else {
474+
*s = '/';
475+
}
471476
}
472477
s[1] = '\0';
473478
if (resource->path && *(resource->path) == '/' && *(resource->path + 1) == '\0') {

0 commit comments

Comments
 (0)