diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-29 13:53:57 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-29 13:53:57 +0200 |
commit | b1c5f7b265b59586b8a3db7f3afa180e262b68b9 (patch) | |
tree | ce9caabae0dea1c7b61de0cc630a68767e045568 /ext/soap/php_sdl.c | |
parent | 71e9013bab22585d47f1f8c02b4c7d93b43298f4 (diff) | |
parent | ff2b5bda59c994ebecdb962a9a63c95dcb2e2ef9 (diff) | |
download | php-git-b1c5f7b265b59586b8a3db7f3afa180e262b68b9.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
Diffstat (limited to 'ext/soap/php_sdl.c')
-rw-r--r-- | ext/soap/php_sdl.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index e11a1f9f99..d06f87d358 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -1173,7 +1173,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) return ctx.sdl; } -#define WSDL_CACHE_VERSION 0x0f +#define WSDL_CACHE_VERSION 0x10 #define WSDL_CACHE_GET(ret,type,buf) memcpy(&ret,*buf,sizeof(type)); *buf += sizeof(type); #define WSDL_CACHE_GET_INT(ret,buf) ret = ((unsigned char)(*buf)[0])|((unsigned char)(*buf)[1]<<8)|((unsigned char)(*buf)[2]<<16)|((int)(*buf)[3]<<24); *buf += 4; @@ -1188,13 +1188,15 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri) #define WSDL_CACHE_PUT_1(val,buf) smart_str_appendc(buf,val); #define WSDL_CACHE_PUT_N(val,n,buf) smart_str_appendl(buf,(char*)val,n); +#define WSDL_NO_STRING_MARKER 0x7fffffff + static char* sdl_deserialize_string(char **in) { char *s; int len; WSDL_CACHE_GET_INT(len, in); - if (len == 0x7fffffff) { + if (len == WSDL_NO_STRING_MARKER) { return NULL; } else { s = emalloc(len+1); @@ -1209,7 +1211,7 @@ static void sdl_deserialize_key(HashTable* ht, void* data, char **in) int len; WSDL_CACHE_GET_INT(len, in); - if (len == 0) { + if (len == WSDL_NO_STRING_MARKER) { zend_hash_next_index_insert_ptr(ht, data); } else { zend_hash_str_add_ptr(ht, *in, len, data); @@ -1777,16 +1779,14 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time static void sdl_serialize_string(const char *str, smart_str *out) { - int i; - if (str) { - i = strlen(str); + int i = strlen(str); WSDL_CACHE_PUT_INT(i, out); if (i > 0) { WSDL_CACHE_PUT_N(str, i, out); } } else { - WSDL_CACHE_PUT_INT(0x7fffffff, out); + WSDL_CACHE_PUT_INT(WSDL_NO_STRING_MARKER, out); } } @@ -1797,7 +1797,7 @@ static void sdl_serialize_key(zend_string *key, smart_str *out) WSDL_CACHE_PUT_INT(ZSTR_LEN(key), out); WSDL_CACHE_PUT_N(ZSTR_VAL(key), ZSTR_LEN(key), out); } else { - WSDL_CACHE_PUT_INT(0, out); + WSDL_CACHE_PUT_INT(WSDL_NO_STRING_MARKER, out); } } |