Skip to content

Commit 9609950

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix bug #77646
2 parents be6f1f6 + e7ca69f commit 9609950

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ PHP NEWS
7474
- Sockets:
7575
. Fixed bug #67619 (Validate length on socket_write). (thiagooak)
7676

77+
- sodium:
78+
. Fixed bug #77646 (sign_detached() strings not terminated). (jedisct1)
79+
7780
- SQLite3:
7881
. Unbundled libsqlite. (cmb)
7982
. Raised requirements to SQLite 3.7.4. (cmb)

ext/sodium/libsodium.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,8 @@ PHP_FUNCTION(sodium_crypto_sign_detached)
16771677
zend_throw_exception(sodium_exception_ce, "signature has a bogus size", 0);
16781678
return;
16791679
}
1680-
ZEND_ASSERT(ZSTR_VAL(signature)[signature_real_len] == 0);
1680+
PHP_SODIUM_ZSTR_TRUNCATE(signature, (size_t) signature_real_len);
1681+
ZSTR_VAL(signature)[signature_real_len] = 0;
16811682

16821683
RETURN_NEW_STR(signature);
16831684
}

0 commit comments

Comments
 (0)