diff options
Diffstat (limited to 'src/sp_cookie_encryption.c')
| -rw-r--r-- | src/sp_cookie_encryption.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sp_cookie_encryption.c b/src/sp_cookie_encryption.c index 8b24a9c..c833f94 100644 --- a/src/sp_cookie_encryption.c +++ b/src/sp_cookie_encryption.c | |||
| @@ -16,7 +16,15 @@ static inline const sp_cookie *sp_lookup_cookie_config(const zend_string *key) { | |||
| 16 | /* called at RINIT time with each cookie, eventually decrypt said cookie */ | 16 | /* called at RINIT time with each cookie, eventually decrypt said cookie */ |
| 17 | int decrypt_cookie(zval *pDest, int num_args, va_list args, | 17 | int decrypt_cookie(zval *pDest, int num_args, va_list args, |
| 18 | zend_hash_key *hash_key) { | 18 | zend_hash_key *hash_key) { |
| 19 | const sp_cookie *cookie = sp_lookup_cookie_config(hash_key->key); | 19 | const zend_string *key = hash_key->key; |
| 20 | const sp_cookie *cookie; | ||
| 21 | |||
| 22 | /* If there is no key, it shouldn't be encrypted. */ | ||
| 23 | if (!key) { | ||
| 24 | return ZEND_HASH_APPLY_KEEP; | ||
| 25 | } | ||
| 26 | |||
| 27 | cookie = sp_lookup_cookie_config(key); | ||
| 20 | 28 | ||
| 21 | /* If the cookie isn't in the conf, it shouldn't be encrypted. */ | 29 | /* If the cookie isn't in the conf, it shouldn't be encrypted. */ |
| 22 | if (!cookie || !cookie->encrypt) { | 30 | if (!cookie || !cookie->encrypt) { |
