mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 07:58:35 +00:00
vim-patch:9.1.1611: possible undefined behaviour in mb_decompose() (#35275)
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: vim/vim#17953
c43a0614d4
Co-authored-by: Áron Hárnási <aron.harnasi@gmail.com>
This commit is contained in:
@@ -1729,7 +1729,8 @@ static void mb_decompose(int c, int *c1, int *c2, int *c3)
|
|||||||
*c3 = d.c;
|
*c3 = d.c;
|
||||||
} else {
|
} else {
|
||||||
*c1 = c;
|
*c1 = c;
|
||||||
*c2 = *c3 = 0;
|
*c2 = 0;
|
||||||
|
*c3 = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user