From: Zbigniew Jędrzejewski-Szmek Date: Mon, 26 May 2025 13:24:04 +0000 (+0200) Subject: coredump: get rid of a bogus assertion X-Git-Tag: v258-rc1~448^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13902e025321242b1d95c6d8b4e482b37f58cdef;p=thirdparty%2Fsystemd.git coredump: get rid of a bogus assertion The check looks plausible, but when I started checking whether it needs to be lowered for the recent changes, I realized that it doesn't make much sense. context_parse_iovw() is called from a few places, e.g.: - process_socket(), where the other side controls the contents of the message. We already do other checks on the correctness of the message and this assert is not needed. - gather_pid_metadata_from_argv(), which is called after inserting MESSAGE_ID= and PRIORITY= into the array, so there is no direct relation between _META_ARGV_MAX and the number of args in the iovw. - gather_pid_metadata_from_procfs(), where we insert a bazillion fields, but without any relation to _META_ARGV_MAX. Since we already separately check if the required stuff was set, drop this misleading check. --- diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index 29ab5eca9a2..442cc10a82f 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -1031,7 +1031,6 @@ static int context_parse_iovw(Context *context, struct iovec_wrapper *iovw) { assert(context); assert(iovw); - assert(iovw->count >= _META_ARGV_MAX); /* Converts the data in the iovec array iovw into separate fields. Fills in context->meta[] (for * which no memory is allocated, it just contains direct pointers into the iovec array memory). */