From aaf1f21dd34b3d68efb44ff669b06496c607865e Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 9 Sep 2022 10:22:42 +0100 Subject: [PATCH] Limit the archive size to 25% of the RAM, or 4G PVS: Expression is always false --- src/fu-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fu-config.c b/src/fu-config.c index 057390220..815abb211 100644 --- a/src/fu-config.c +++ b/src/fu-config.c @@ -172,7 +172,7 @@ fu_config_reload(FuConfig *self, GError **error) guint64 memory_size = fu_common_get_memory_size(); g_autofree gchar *str = NULL; if (memory_size > 0) { - self->archive_size_max = MAX(memory_size / 4, G_MAXSIZE); + self->archive_size_max = MIN(memory_size / 4, G_MAXUINT32); str = g_format_size(self->archive_size_max); g_debug("using autodetected max archive size %s", str); } else {