projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
fix crash with free'd event_base pointer
[m6w6/ext-http]
/
php_http_cookie.c
diff --git
a/php_http_cookie.c
b/php_http_cookie.c
index 6908d386247e4b09de79af5b3e4618beb8887ffe..5b8878306f76fd51c3a9fde1f9f6fea953ca54a7 100644
(file)
--- a/
php_http_cookie.c
+++ b/
php_http_cookie.c
@@
-136,13
+136,11
@@
static void add_entry(php_http_cookie_list_t *list, char **allowed_extras, long
} else if _KEY_IS("httpOnly") {
list->flags |= PHP_HTTP_COOKIE_HTTPONLY;
} else {
} else if _KEY_IS("httpOnly") {
list->flags |= PHP_HTTP_COOKIE_HTTPONLY;
} else {
- char buf[0x20];
-
- php_http_array_hashkey_stringify(key);
/* check for extra */
if (allowed_extras) {
char **ae = allowed_extras;
/* check for extra */
if (allowed_extras) {
char **ae = allowed_extras;
+ php_http_array_hashkey_stringify(key);
for (; *ae; ++ae) {
if (!strncasecmp(key->str, *ae, key->len)) {
if (key->type == HASH_KEY_IS_LONG) {
for (; *ae; ++ae) {
if (!strncasecmp(key->str, *ae, key->len)) {
if (key->type == HASH_KEY_IS_LONG) {
@@
-150,11
+148,12
@@
static void add_entry(php_http_cookie_list_t *list, char **allowed_extras, long
} else {
zend_hash_update(&list->extras, key->str, key->len, (void *) &arg, sizeof(zval *), NULL);
}
} else {
zend_hash_update(&list->extras, key->str, key->len, (void *) &arg, sizeof(zval *), NULL);
}
+ php_http_array_hashkey_stringfree(key);
return;
}
}
return;
}
}
+ php_http_array_hashkey_stringfree(key);
}
}
- php_http_array_hashkey_stringfree(key);
/* cookie */
if (key->type == HASH_KEY_IS_LONG) {
/* cookie */
if (key->type == HASH_KEY_IS_LONG) {
@@
-552,6
+551,15
@@
PHP_METHOD(HttpCookie, __construct)
break;
}
}
break;
}
}
+
+ if (ae) {
+ char **ae_ptr;
+
+ for (ae_ptr = ae; *ae_ptr; ++ae_ptr) {
+ efree(*ae_ptr);
+ }
+ efree(ae);
+ }
} end_error_handling();
}
}
} end_error_handling();
}
}