]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2141: Truncation when serializing libsodium encryption parameters v9.1.2141
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Sun, 8 Feb 2026 21:04:51 +0000 (21:04 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 8 Feb 2026 21:07:42 +0000 (21:07 +0000)
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>
runtime/doc/version9.txt
src/crypt.c
src/version.c

index e2bc66be0461e048dde1aeefdd936796ce66904b..c5ed3da001f0614813af434ea701e50680fd78c8 100644 (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
index da1022644d90fbcd79701750a52856611a0bd41c..794594f91042a52cbd087fa4cb3d20dc40e1beea 100644 (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;
     }
 }
 
index e6b867cf6d97efea2d4c75dd8373ab276dd47f2d..5f437f42d6532804bd29059d78f1394eeaa9c5cf 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2141,
 /**/
     2140,
 /**/