Skip to content

Commit 08089b5

Browse files
committed
Fix bug #77646
1 parent 934691f commit 08089b5

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
@@ -5,6 +5,9 @@ PHP NEWS
55
- MySQLi:
66
. Fixed bug #77597 (mysqli_fetch_field hangs scripts). (Nikita)
77

8+
- sodium:
9+
. Fixed bug #77646 (sign_detached() strings not terminated). (Frank)
10+
811
07 Mar 2019, PHP 7.2.16
912

1013
- Core:

ext/sodium/libsodium.c

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

16831684
RETURN_STR(signature);
16841685
}

0 commit comments

Comments
 (0)