From: Yasuhiro Matsumoto Date: Sun, 8 Feb 2026 21:04:51 +0000 (+0000) Subject: patch 9.1.2141: Truncation when serializing libsodium encryption parameters X-Git-Tag: v9.1.2141^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60e93b5de7b2ebdf39a84f6d19873ac4d4686a57;p=thirdparty%2Fvim.git 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 Signed-off-by: Christian Brabandt --- diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index e2bc66be04..c5ed3da001 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -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 diff --git a/src/crypt.c b/src/crypt.c index da1022644d..794594f910 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -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; } } diff --git a/src/version.c b/src/version.c index e6b867cf6d..5f437f42d6 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2141, /**/ 2140, /**/