From: Franck Bui Date: Fri, 21 Jun 2019 14:18:39 +0000 (+0200) Subject: coredump: fix the check on the number of passed args in backtrace mode X-Git-Tag: v243-rc1~219^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2705fcd63bd2cd4203cbc5ff00cd2914e39febed;p=thirdparty%2Fsystemd.git coredump: fix the check on the number of passed args in backtrace mode In backtrace mode, '--backtrace' option should also be counted. --- diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index add43e7b6f9..51e8a5f0832 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -1254,10 +1254,10 @@ static int process_backtrace(int argc, char *argv[]) { log_debug("Processing backtrace on stdin..."); - if (argc < CONTEXT_COMM + 1) + if (argc < CONTEXT_COMM + 2) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Not enough arguments passed (%i, expected %i).", - argc - 1, CONTEXT_COMM + 1 - 1); + argc - 1, CONTEXT_COMM + 2 - 1); context[CONTEXT_PID] = argv[2 + CONTEXT_PID]; context[CONTEXT_UID] = argv[2 + CONTEXT_UID];