def sanitize_exceptions(exceptions, sensitive_values):
    """
    Sanitize sensitive data from a list of exceptions. Return the sanitized
    exceptions.
    """
    for exc in exceptions:
        infos = exc.get('infos')
        if infos is not None:
            args = infos.get('args')
            if args is not None and sensitive_values:
                infos.pop('args', None)
            waf_infos = infos.get('waf')
            if waf_infos is not None and sensitive_values:
                waf_infos.pop('args', None)
        yield exc
