From: Michael Tremer Date: Sun, 23 Oct 2022 14:53:15 +0000 (+0000) Subject: arch: Fix off-by-one error in allocation X-Git-Tag: 0.9.28~236^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=feae352fd4731995805716adf9c69d95b9734d78;p=pakfire.git arch: Fix off-by-one error in allocation Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/arch.c b/src/libpakfire/arch.c index 2d28b1594..161a41c52 100644 --- a/src/libpakfire/arch.c +++ b/src/libpakfire/arch.c @@ -139,7 +139,7 @@ PAKFIRE_EXPORT const char** pakfire_supported_arches() { if (!__pakfire_supported_arches) { for (const struct pakfire_arch* arch = PAKFIRE_ARCHES; arch->name; arch++) { __pakfire_supported_arches = reallocarray(__pakfire_supported_arches, - counter + 1, sizeof(*__pakfire_supported_arches)); + counter + 2, sizeof(*__pakfire_supported_arches)); // Exit if the allocation failed if (!__pakfire_supported_arches)