From 611fa16e5d52e3109ed208186587c48cb7bc8d11 Mon Sep 17 00:00:00 2001 From: Fabio Luongo Date: Tue, 12 Nov 2024 23:24:06 +0100 Subject: [PATCH] Fix buffer overflow when opening the Fit Panel --- gui/gui/src/TGNumberEntry.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/gui/src/TGNumberEntry.cxx b/gui/gui/src/TGNumberEntry.cxx index 56d39d00fc709..1f56c2a14de43 100644 --- a/gui/gui/src/TGNumberEntry.cxx +++ b/gui/gui/src/TGNumberEntry.cxx @@ -305,13 +305,13 @@ static char *RealToStr(char *text, const RealInfo_t & ri) StrInt(p, TMath::Abs(ri.fIntNum), 0); p += strlen(p); if ((ri.fStyle == kRSFrac) || (ri.fStyle == kRSFracExpo)) { - strlcpy(p, ".", 256-strlen(p)); + strlcpy(p, ".", 256-strlen(text)); p++; StrInt(p, TMath::Abs(ri.fFracNum), ri.fFracDigits); p += strlen(p); } if ((ri.fStyle == kRSExpo) || (ri.fStyle == kRSFracExpo)) { - strlcpy(p, "e", 256-strlen(p)); + strlcpy(p, "e", 256-strlen(text)); p++; StrInt(p, ri.fExpoNum, 0); p += strlen(p);