Fixed bug #50219 (soap call Segmentation fault on a redirected url).

This commit is contained in:
Pierrick Charron 2009-11-21 01:22:32 +00:00
parent e53f363548
commit 84ab9cd30e
2 changed files with 16 additions and 6 deletions

2
NEWS
View file

@ -24,6 +24,8 @@ PHP NEWS
(Pierre) (Pierre)
- Fixed bug #50219 (soap call Segmentation fault on a redirected url).
(Pierrick)
- Fixed bug #50212 (crash by ldap_get_option() with LDAP_OPT_NETWORK_TIMEOUT). - Fixed bug #50212 (crash by ldap_get_option() with LDAP_OPT_NETWORK_TIMEOUT).
(Ilia, shigeru_kitazaki at cybozu dot co dot jp) (Ilia, shigeru_kitazaki at cybozu dot co dot jp)
- Fixed bug #50207 (segmentation fault when concatenating very large strings on - Fixed bug #50207 (segmentation fault when concatenating very large strings on

View file

@ -990,6 +990,7 @@ try_again:
new_url->host = phpurl->host ? estrdup(phpurl->host) : NULL; new_url->host = phpurl->host ? estrdup(phpurl->host) : NULL;
new_url->port = phpurl->port; new_url->port = phpurl->port;
if (new_url->path && new_url->path[0] != '/') { if (new_url->path && new_url->path[0] != '/') {
if (phpurl->path) {
char *t = phpurl->path; char *t = phpurl->path;
char *p = strrchr(t, '/'); char *p = strrchr(t, '/');
if (p) { if (p) {
@ -1000,6 +1001,13 @@ try_again:
efree(new_url->path); efree(new_url->path);
new_url->path = s; new_url->path = s;
} }
} else {
char *s = emalloc(strlen(new_url->path) + 2);
s[0] = '/'; s[1] = 0;
strcat(s, new_url->path);
efree(new_url->path);
new_url->path = s;
}
} }
} }
phpurl = new_url; phpurl = new_url;