]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1611: possible undefined behaviour in mb_decompose() v9.1.1611
authorÁron Hárnási <aron.harnasi@gmail.com>
Sat, 9 Aug 2025 21:43:13 +0000 (23:43 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 9 Aug 2025 21:43:13 +0000 (23:43 +0200)
Problem:  possible undefined behaviour in mb_decompose(), when using the
          same pointer as argument several times
Solution: use separate assignments to avoid reading and writing the same
          object at the same time (Áron Hárnási)

closes: #17953

Signed-off-by: Áron Hárnási <aron.harnasi@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/regexp.c
src/version.c

index e37dd3c5bd068f4fc1a51b9e8d5798644a028c9c..305ca896e3ca20459e0a3c75577954801e9b6399 100644 (file)
@@ -1722,7 +1722,8 @@ mb_decompose(int c, int *c1, int *c2, int *c3)
     else
     {
        *c1 = c;
-       *c2 = *c3 = 0;
+       *c2 = 0;
+       *c3 = 0;
     }
 }
 
index e2c46855e43be1b3325acfc204cc2db182f9ddf7..4716c5d0d8c131554c237de7525f7db3c3423f0f 100644 (file)
@@ -719,6 +719,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1611,
 /**/
     1610,
 /**/