patch 9.1.2141: Truncation when serializing libsodium encryption parameters

Problem:  Truncation when serializing libsodium encryption parameters.
Solution: Correctly cast to long long type (Yasuhiro Matsumoto).

fixes:  #19248
closes: #19357

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yasuhiro Matsumoto
2026-02-08 21:04:51 +00:00
committed by Christian Brabandt
parent b422a33ac2
commit 60e93b5de7
3 changed files with 9 additions and 3 deletions
+5 -1
View File
@@ -1,4 +1,4 @@
*version9.txt* For Vim version 9.1. Last change: 2026 Feb 07
*version9.txt* For Vim version 9.1. Last change: 2026 Feb 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -52528,4 +52528,8 @@ Problem: tests: Test_wayland_protocol_error_overflow() fails
(after v9.1.2139)
Solution: try/catch the expected error
Patch 9.1.2141
Problem: Truncation when serializing libsodium encryption parameters.
Solution: Correctly cast to long long type (Yasuhiro Matsumoto).
vim:tw=78:ts=8:noet:ft=help:norl:fdm=manual:nofoldenable
+2 -2
View File
@@ -1356,7 +1356,7 @@ crypt_long_long_to_char(long long n, char_u *s)
for (i = 0; i < 8; i++)
{
s[i] = (char_u)(n & 0xff);
n = (unsigned)n >> 8;
n = (unsigned long long)n >> 8;
}
}
@@ -1367,7 +1367,7 @@ crypt_int_to_char(int n, char_u *s)
for (i = 0; i < 4; i++)
{
s[i] = (char_u)(n & 0xff);
n = (unsigned)n >> 8;
n = (unsigned long long)n >> 8;
}
}
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2141,
/**/
2140,
/**/