check_range_index_one() expects a long * parameter, but n1 is a
varnumber_T. On big-endian platforms where long is not 64-bit, casting
the varnumber_T * to long * passes a pointer to the wrong bytes.
Use a local long variable, after validating the value fits within a
long, and pass that pointer to check_range_index_one().
Validated on 32-bit powerpc, s390x, and x86.
Closes: #19798
https://github.com/vim/vim/pull/19952
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
thanks for finding this out. Is it possible to test and validate this so that it doesn't regress in the future?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
In this line
if (n1 < 0 || n1 >= len || n1 > LONG_MAX || n1 < LONG_MIN)
the check for n1 < LONG_MIN seems to be superfluous because there is already a check for n1 < 0 (and LONG_MIN is surely at most 0). Of course the compiler will likely optimize it away for the same reason.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@jamessan pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Is it possible to test and validate this so that it doesn't regress in the future?
I'm not sure how, without adding big-endian build/test to CI.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()