diff options
| author | slefevre | 2017-12-19 14:50:09 +0100 |
|---|---|---|
| committer | slefevre | 2017-12-19 14:50:09 +0100 |
| commit | 560b6fc407237aa240e7a76691f6ab46562b0fa0 (patch) | |
| tree | 02d0910896566f7014b48fc08c044b2d3e967c90 /src/sp_cookie_encryption.c | |
| parent | b8732c92db07a3e68bb2314e759f409157e93133 (diff) | |
remove useless var
Diffstat (limited to 'src/sp_cookie_encryption.c')
| -rw-r--r-- | src/sp_cookie_encryption.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/sp_cookie_encryption.c b/src/sp_cookie_encryption.c index 5c3c372..9e585c5 100644 --- a/src/sp_cookie_encryption.c +++ b/src/sp_cookie_encryption.c | |||
| @@ -42,7 +42,6 @@ static inline void generate_key(unsigned char *key) { | |||
| 42 | int decrypt_cookie(zval *pDest, int num_args, va_list args, | 42 | int decrypt_cookie(zval *pDest, int num_args, va_list args, |
| 43 | zend_hash_key *hash_key) { | 43 | zend_hash_key *hash_key) { |
| 44 | unsigned char key[crypto_secretbox_KEYBYTES] = {0}; | 44 | unsigned char key[crypto_secretbox_KEYBYTES] = {0}; |
| 45 | size_t value_len; | ||
| 46 | zend_string *debase64; | 45 | zend_string *debase64; |
| 47 | unsigned char *decrypted; | 46 | unsigned char *decrypted; |
| 48 | sp_cookie *cookie = zend_hash_find_ptr(SNUFFLEUPAGUS_G(config).config_cookie->cookies, | 47 | sp_cookie *cookie = zend_hash_find_ptr(SNUFFLEUPAGUS_G(config).config_cookie->cookies, |
| @@ -56,13 +55,11 @@ int decrypt_cookie(zval *pDest, int num_args, va_list args, | |||
| 56 | 55 | ||
| 57 | generate_key(key); | 56 | generate_key(key); |
| 58 | 57 | ||
| 59 | value_len = Z_STRLEN_P(pDest); | 58 | if (Z_STRLEN_P(pDest) == 0) { |
| 60 | |||
| 61 | if (value_len == 0) { | ||
| 62 | return ZEND_HASH_APPLY_KEEP; | 59 | return ZEND_HASH_APPLY_KEEP; |
| 63 | } | 60 | } |
| 64 | 61 | ||
| 65 | debase64 = php_base64_decode((unsigned char *)(Z_STRVAL_P(pDest)), value_len); | 62 | debase64 = php_base64_decode((unsigned char *)(Z_STRVAL_P(pDest)), Z_STRLEN_P(pDest)); |
| 66 | 63 | ||
| 67 | if (ZSTR_LEN(debase64) < | 64 | if (ZSTR_LEN(debase64) < |
| 68 | crypto_secretbox_NONCEBYTES + crypto_secretbox_ZEROBYTES) { | 65 | crypto_secretbox_NONCEBYTES + crypto_secretbox_ZEROBYTES) { |
