STR_FREE(encoded);
updated_len += encoded_len;
RETURN_STRINGL(updated, updated_len, 0);
- } else {
+ } else if (encoded) {
RETVAL_STRINGL(encoded, encoded_len, 0);
+ } else {
+ RETVAL_NULL();
}
} else {
RETVAL_FALSE;
STR_FREE(decoded);
updated_len += decoded_len;
RETVAL_STRINGL(updated, updated_len, 0);
- } else {
+ } else if (decoded) {
STR_FREE(updated);
RETVAL_STRINGL(decoded, decoded_len, 0);
+ } else {
+ RETVAL_NULL();
}
} else {
STR_FREE(updated);
{
http_message_object *o = (http_message_object *) object;
+ if (o->iterator) {
+ zval_ptr_dtor(&o->iterator);
+ o->iterator = NULL;
+ }
if (o->message) {
http_message_dtor(o->message);
efree(o->message);
}
convert_to_double(zv);
- sprintf(v, "%1.1lf", Z_DVAL_P(zv));
+ snprintf(v, sizeof(v), "%1.1f", Z_DVAL_P(zv));
if (strcmp(v, "1.0") && strcmp(v, "1.1")) {
- http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid HTTP protocol version (1.0 or 1.1): %s", v);
+ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid HTTP protocol version (1.0 or 1.1): %g", Z_DVAL_P(zv));
RETURN_FALSE;
}
static int apply_pretty_key(void *pDest, int num_args, va_list args, zend_hash_key *hash_key)
{
- if (hash_key->nKeyLength > 1) {
+ if (hash_key->arKey && hash_key->nKeyLength > 1) {
hash_key->h = zend_hash_func(pretty_key(hash_key->arKey, hash_key->nKeyLength - 1, 1, 0), hash_key->nKeyLength);
}
return ZEND_HASH_APPLY_KEEP;