TspineDit's vulnerability

zhaozj2021-02-11  207

Recently, when the SpineDit control in the Samples page is used, it is discovered that spinedit's maximum (MINVALUE) and minvalue have vulnerabilities. When the maximum value and the minimum are equal and not zero, the set shape is equivalent; when the maximum is less than the minimum, the value of SpineDit is the maximum value and the minimum. When viewing Spin.pas found, SpinEdit CheckValue the following function: function TSpinEdit.CheckValue (NewValue: LongInt): LongInt; begin Result: = NewValue; if (FMaxValue <> FMinValue) then begin if NewValue FmaxValue The Result: = fMaxValue; end; end; It can be seen without maxValue = minvalue and Minvalue <> 0 and MaxValue

I spent a lot of time debugging prior to discovering this problem, thinking is the problem of code. The result was found to be a bug. This issue may have discovered and raised it, but I didn't see it. But I still put it out, I hope other friends should not waste time on this issue. Oh, in fact, I still want to earn points in private :).

转载请注明原文地址:https://www.9cbs.com/read-4365.html

New Post(0)