[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/misra: xen-analysis.py: Fix latent bug



commit 8bd504290bc3e5fb4d04150f96a36783407661b4
Author:     Luca Fancellu <luca.fancellu@xxxxxxx>
AuthorDate: Tue May 30 11:57:02 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue May 30 11:57:02 2023 +0200

    xen/misra: xen-analysis.py: Fix latent bug
    
    Currenly there is a latent bug that is not triggered because
    the function cppcheck_merge_txt_fragments is called with the
    parameter strip_paths having a list of only one element.
    
    The bug is that the split function should not be in the
    loop for strip_paths, but one level before, fix it.
    
    Fixes: 02b26c02c7c4 ("xen/scripts: add cppcheck tool to the xen-analysis.py 
script")
    Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
    Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
    Tested-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/scripts/xen_analysis/cppcheck_report_utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/scripts/xen_analysis/cppcheck_report_utils.py 
b/xen/scripts/xen_analysis/cppcheck_report_utils.py
index c5f466aff1..fdc299c7e0 100644
--- a/xen/scripts/xen_analysis/cppcheck_report_utils.py
+++ b/xen/scripts/xen_analysis/cppcheck_report_utils.py
@@ -104,8 +104,8 @@ def cppcheck_merge_txt_fragments(fragments_list, 
out_txt_file, strip_paths):
                 for path in strip_paths:
                     text_report_content[i] = text_report_content[i].replace(
                                                                 path + "/", "")
-                    # Split by : separator
-                    text_report_content[i] = text_report_content[i].split(":")
+                # Split by : separator
+                text_report_content[i] = text_report_content[i].split(":")
 
             # sort alphabetically for second field (misra rule) and as second
             # criteria for the first field (file name)
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.