BSlider: Copy the UpdateText inside UpdateTextChanged.

We can't rely on it not changing between calls, especially as
MaxUpdateTextWidth() changes the value and re-gets it, and
that's called at the end of this method always. So we need to
keep our own copy rather than using the one that's owned by
the subclass.

Fixes a use-after-free uncovered by the guarded heap in VolumeSlider,
reported in #19493.
This commit is contained in:
Augustin Cavalier
2025-03-21 11:54:37 -04:00
parent aa2b9830e1
commit c6f736315a
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -201,7 +201,7 @@ private:
char* fMinLimitLabel;
char* fMaxLimitLabel;
const char* fUpdateText;
char* fUpdateText;
int32 fMinValue;
int32 fMaxValue;