• Xi Wang's avatar
    audit: fix signedness bug in audit_log_execve_info() · 5afb8a3f
    Xi Wang authored
    In the loop, a size_t "len" is used to hold the return value of
    audit_log_single_execve_arg(), which returns -1 on error.  In that
    case the error handling (len <= 0) will be bypassed since "len" is
    unsigned, and the loop continues with (p += len) being wrapped.
    Change the type of "len" to signed int to fix the error handling.
    
    	size_t len;
    	...
    	for (...) {
    		len = audit_log_single_execve_arg(...);
    		if (len <= 0)
    			break;
    		p += len;
    	}
    Signed-off-by: default avatarXi Wang <xi.wang@gmail.com>
    Signed-off-by: default avatarEric Paris <eparis@redhat.com>
    5afb8a3f
auditsc.c 71.2 KB