diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-10 21:26:54 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-02-10 21:55:51 +0800 |
commit | 5bbb733a1b16b0c9d2303c1464bf66ee434450ac (patch) | |
tree | b1717f97c6ea7fdf5ee21a3a1027d63d3806e21d /runtime/lua/vim/lsp/client.lua | |
parent | 71429c90eeb979c6062ee845e516d28b5e6ce402 (diff) | |
download | rneovim-5bbb733a1b16b0c9d2303c1464bf66ee434450ac.tar.gz rneovim-5bbb733a1b16b0c9d2303c1464bf66ee434450ac.tar.bz2 rneovim-5bbb733a1b16b0c9d2303c1464bf66ee434450ac.zip |
vim-patch:9.1.0089: qsort() comparison functions should be transitive
Problem: qsort() comparison functions should be transitive
Solution: Do not subtract values, but rather use explicit comparisons
Improve qsort() comparison functions
There has been a recent report on qsort() causing out-of-bounds read &
write in glibc for non transitive comparison functions
https://www.qualys.com/2024/01/30/qsort.txt
Even so the bug is in glibc's implementation of the qsort() algorithm,
it's bad style to just use substraction for the comparison functions,
which may cause overflow issues and as hinted at in OpenBSD's manual
page for qsort(): "It is almost always an error to use subtraction to
compute the return value of the comparison function."
So check the qsort() comparison functions and change them to be safe.
closes: vim/vim#13980
https://github.com/vim/vim/commit/e06e43766500ecb4cd1031fa16cf9cbebdb222c1
Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime/lua/vim/lsp/client.lua')
0 files changed, 0 insertions, 0 deletions