Skip to content

Fix bug #70951: Segmentation fault on invalid WSDL cache #18707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ext/soap/php_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
# define O_BINARY 0
#endif

#ifdef WORDS_BIGENDIAN
# define SOAP_BIG_ENDIAN 1
#else
# define SOAP_BIG_ENDIAN 0
#endif

static void delete_fault(zval *zv);
static void delete_fault_persistent(zval *zv);
static void delete_binding(zval *zv);
Expand Down Expand Up @@ -3188,9 +3194,13 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl)
char *user = php_get_current_user();
size_t user_len = user ? strlen(user) + 1 : 0;

/* System architecture identification (see bug #70951) */
static const char ids[] = {SIZEOF_ZEND_LONG, SOAP_BIG_ENDIAN};

md5str[0] = '\0';
PHP_MD5Init(&md5_context);
PHP_MD5Update(&md5_context, (unsigned char*)uri, uri_len);
PHP_MD5Update(&md5_context, ids, sizeof(ids));
PHP_MD5Final(digest, &md5_context);
make_digest(md5str, digest);
key = emalloc(len+sizeof("/wsdl-")-1+user_len+2+sizeof(md5str));
Expand Down