From: Michael Tremer Date: Sat, 2 Nov 2024 19:57:37 +0000 (+0000) Subject: libpakfire: Fix order of arguments in reallocarray X-Git-Tag: 0.9.30~793 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3b43dd528bec4264433868d8574b79321a93890;p=pakfire.git libpakfire: Fix order of arguments in reallocarray Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/parser.c b/src/libpakfire/parser.c index 01673c63b..ec59ca7fa 100644 --- a/src/libpakfire/parser.c +++ b/src/libpakfire/parser.c @@ -341,7 +341,7 @@ int pakfire_parser_set(struct pakfire_parser* parser, // Assign new declaration to array parser->declarations = reallocarray(parser->declarations, - sizeof(*parser->declarations), parser->num_declarations + 1); + parser->num_declarations + 1, sizeof(*parser->declarations)); parser->declarations[parser->num_declarations++] = d; return 0; diff --git a/src/libpakfire/path.c b/src/libpakfire/path.c index 4ec117cac..7893c15c6 100644 --- a/src/libpakfire/path.c +++ b/src/libpakfire/path.c @@ -64,8 +64,7 @@ static int pakfire_path_insert_segment(struct pakfire_path* path, unsigned int i return -ERANGE; // Make space - path->segments = reallocarray(path->segments, sizeof(*path->segments), - path->num_segments + 2); + path->segments = reallocarray(path->segments, path->num_segments + 2, sizeof(*path->segments)); // Fail if we could not make space if (!path->segments)