Skip to content

Commit e7ca69f

Browse files
committed
Fix bug #77646
1 parent e5d8ac9 commit e7ca69f

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). (jedisct1)
10+
811
21 Feb 2019, PHP 7.3.3
912

1013
- Core:

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)