Language: Python
Label: safe
CWE: NVD-CWE-noinfo \u2014 

Code:
def clear_filename(filename: str):
    """
    Removes path symbols from filename which could be used for path injection
    :param s:
    :return:
    """

    if not filename:
        return filename
    badchars = '\\/:*?\"<>|'
    for c in badchars:
        filename = filename.replace(c, '')
    return filename