In new_logline check for NULL args->reason for EVLOG_RAW.
This can't happen in practice since we never set EVLOG_RAW without passing in a reason. Coverity CID 237142 237143
This commit is contained in:
@@ -106,12 +106,14 @@ new_logline(int event_type, int flags, struct eventlog_args *args,
|
|||||||
debug_decl(new_logline, SUDO_DEBUG_UTIL);
|
debug_decl(new_logline, SUDO_DEBUG_UTIL);
|
||||||
|
|
||||||
if (ISSET(flags, EVLOG_RAW)) {
|
if (ISSET(flags, EVLOG_RAW)) {
|
||||||
if (args->errstr != NULL) {
|
if (args->reason != NULL) {
|
||||||
if (asprintf(&line, "%s: %s", args->reason, args->errstr) == -1)
|
if (args->errstr != NULL) {
|
||||||
goto oom;
|
if (asprintf(&line, "%s: %s", args->reason, args->errstr) == -1)
|
||||||
} else {
|
goto oom;
|
||||||
if ((line = strdup(args->reason)) == NULL)
|
} else {
|
||||||
goto oom;
|
if ((line = strdup(args->reason)) == NULL)
|
||||||
|
goto oom;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
debug_return_str(line);
|
debug_return_str(line);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user