proper fix for #47
authorMichael Wallner <mike@php.net>
Wed, 13 Jul 2016 11:14:43 +0000 (13:14 +0200)
committerMichael Wallner <mike@php.net>
Wed, 13 Jul 2016 11:14:43 +0000 (13:14 +0200)
src/php_http_params.c

index c0071ac430aa690e934898e922d83fae62268c07..fc75f0e96140151f52e918ec8136cbf9140c8304 100644 (file)
@@ -522,12 +522,10 @@ static void merge_param(HashTable *params, zval *zdata, zval ***current_param, z
 
 static void push_param(HashTable *params, php_http_params_state_t *state, const php_http_params_opts_t *opts TSRMLS_DC)
 {
-       if (!state->current.val) {
-               return;
-       }
-
        if (state->val.str) {
-               if (0 < (state->val.len = state->input.str - state->val.str)) {
+               if (!state->current.val) {
+                       return;
+               } else if (0 < (state->val.len = state->input.str - state->val.str)) {
                        sanitize_value(opts->flags, state->val.str, state->val.len, *(state->current.val), state->rfc5987 TSRMLS_CC);
                } else {
                        ZVAL_EMPTY_STRING(*(state->current.val));