From e3d49b919d2958af6b3286c01de87e73c638fb50 Mon Sep 17 00:00:00 2001 From: Adam Mitz Date: Fri, 9 Feb 2024 15:06:03 +0000 Subject: [PATCH] Avoid potential out-of-bounds read in ACE_CDR::Fixed::from_string (cherry picked from commit 90258afc7c510ead3ace1e30382bb5ba877610b3) --- ACE/ace/CDR_Base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACE/ace/CDR_Base.cpp b/ACE/ace/CDR_Base.cpp index f2213f379eb6a..e5e96bdd8bc17 100644 --- a/ACE/ace/CDR_Base.cpp +++ b/ACE/ace/CDR_Base.cpp @@ -932,7 +932,7 @@ ACE_CDR::Fixed ACE_CDR::Fixed::from_string (const char *str) ++f.digits_; } - if (!f.scale_ && str[span - f.digits_ - 1] == '.') + if (!f.scale_ && span > f.digits_ && str[span - f.digits_ - 1] == '.') f.scale_ = f.digits_; if (idx >= 0)