Patch sodium_crypto_sign_detached-zero-termination.patch for *Encryption and hash functions Bug #77646
Patch version 2019-02-21 13:15 UTC
Return to Bug #77646 |
Download this patch
Patch Revisions:
Developer: thomaswouters+bugs.php.net@gmail.com
--- a/ext/sodium/libsodium.c
+++ b/ext/sodium/libsodium.c
@@ -1677,7 +1677,8 @@
zend_throw_exception(sodium_exception_ce, "signature has a bogus size", 0);
return;
}
- ZEND_ASSERT(ZSTR_VAL(signature)[signature_real_len] == 0);
+ PHP_SODIUM_ZSTR_TRUNCATE(signature, (size_t) signature_real_len);
+ ZSTR_VAL(signature)[signature_real_len] = 0;
RETURN_NEW_STR(signature);
}
|