diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 2c2e282ff7..219964f0f6 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -5459,6 +5459,14 @@ helper_have_data(int fd, GIOCondition condition, gpointer user_data) n_read = nm_utils_fd_read(fd, &info->in_buffer); _LOG2T(info, "read returns %ld", (long) n_read); + if (info->in_buffer.len > 32 * 1024 * 1024) { + helper_complete(info, + g_error_new_literal(NM_UTILS_ERROR, + NM_UTILS_ERROR_UNKNOWN, + "the output is larger than 32MiB")); + return G_SOURCE_CONTINUE; + } + if (n_read > 0) return G_SOURCE_CONTINUE;