Skip to content
Snippets Groups Projects
  • Philippe Reynes's avatar
    3f05f087
    test/cmd_ut.c: fix cmd_ut_category · 3f05f087
    Philippe Reynes authored
    
    In the function cmd_ut_category, the prefix is used with
    the function strncmp to know if the prefix should be
    removed from the test name, even if the prefix is NULL.
    
    To avoid this issue, we consider that a prefix NULL
    mean no prefix. So we only try to remove the prefix
    from the test_name if the prefix is not NULL, then
    we avoid to call the function strncmp with a NULL
    prefix.
    
    Reported-by: Coverity CID 281110
    Fixes: 4ad4edfe ("cmd_ut: add a parameter prefix to the function cmd_ut_category")
    Signed-off-by: default avatarPhilippe Reynes <philippe.reynes@softathome.com>
    3f05f087
    History
    test/cmd_ut.c: fix cmd_ut_category
    Philippe Reynes authored
    
    In the function cmd_ut_category, the prefix is used with
    the function strncmp to know if the prefix should be
    removed from the test name, even if the prefix is NULL.
    
    To avoid this issue, we consider that a prefix NULL
    mean no prefix. So we only try to remove the prefix
    from the test_name if the prefix is not NULL, then
    we avoid to call the function strncmp with a NULL
    prefix.
    
    Reported-by: Coverity CID 281110
    Fixes: 4ad4edfe ("cmd_ut: add a parameter prefix to the function cmd_ut_category")
    Signed-off-by: default avatarPhilippe Reynes <philippe.reynes@softathome.com>