Skip to content

Commit

Permalink
Merge branch 'PHP-7.3' into PHP-7.4
Browse files Browse the repository at this point in the history
* PHP-7.3:
  Fix bug #77646
  • Loading branch information
jedisct1 committed Feb 21, 2019
2 parents be6f1f6 + e7ca69f commit 9609950
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ PHP NEWS
- Sockets:
. Fixed bug #67619 (Validate length on socket_write). (thiagooak)

- sodium:
. Fixed bug #77646 (sign_detached() strings not terminated). (jedisct1)

- SQLite3:
. Unbundled libsqlite. (cmb)
. Raised requirements to SQLite 3.7.4. (cmb)
Expand Down
3 changes: 2 additions & 1 deletion ext/sodium/libsodium.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,8 @@ PHP_FUNCTION(sodium_crypto_sign_detached)
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);
}
Expand Down

0 comments on commit 9609950

Please sign in to comment.