Fix 32207 [gprofng collect app] Error in parsing the -O option

Message ID 20240925223319.2519606-1-vladimir.mezentsev@oracle.com
State New
Headers
Series Fix 32207 [gprofng collect app] Error in parsing the -O option |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

Vladimir Mezentsev Sept. 25, 2024, 10:33 p.m. UTC
  From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

gprofng/ChangeLog
2024-09-25  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR 32207
	* src/collctrl.cc (preprocess_names): Fix the size in strndup.
---
 gprofng/src/collctrl.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gprofng/src/collctrl.cc b/gprofng/src/collctrl.cc
index d341cb00fca..2fa9a883147 100644
--- a/gprofng/src/collctrl.cc
+++ b/gprofng/src/collctrl.cc
@@ -2422,7 +2422,7 @@  Coll_Ctrl::preprocess_names ()
     }
   else
     {
-      expt_dir = dbe_strndup (expt_name, s - expt_name - 1);
+      expt_dir = dbe_strndup (expt_name, s - expt_name);
       base_name = strdup (s + 1);
     }