Skip to content

Commit c43a061

Browse files
ConcreteCactuschrisbra
authored andcommitted
patch 9.1.1611: possible undefined behaviour in mb_decompose()
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>
1 parent c65643c commit c43a061

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/regexp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1722,7 +1722,8 @@ mb_decompose(int c, int *c1, int *c2, int *c3)
17221722
else
17231723
{
17241724
*c1 = c;
1725-
*c2 = *c3 = 0;
1725+
*c2 = 0;
1726+
*c3 = 0;
17261727
}
17271728
}
17281729

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ static char *(features[]) =
719719

720720
static int included_patches[] =
721721
{ /* Add new patch number below this line */
722+
/**/
723+
1611,
722724
/**/
723725
1610,
724726
/**/

0 commit comments

Comments
 (0)