From ed12b4f709617026c581edb0b4294d82d781ac39 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 9 Dec 2022 16:27:52 +0000 Subject: [PATCH] repo: Avoid reading past the end of the key buffer Signed-off-by: Michael Tremer --- src/libpakfire/repo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpakfire/repo.c b/src/libpakfire/repo.c index a0e988608..05136a984 100644 --- a/src/libpakfire/repo.c +++ b/src/libpakfire/repo.c @@ -860,7 +860,7 @@ PAKFIRE_EXPORT int pakfire_repo_write_config(struct pakfire_repo* repo, FILE* f) goto ERROR; } - r = pakfire_config_set(config, section, "key", buffer); + r = pakfire_config_set_format(config, section, "key", "%.*s", length, buffer); if (r) { ERROR(repo->pakfire, "Could not set key: %m\n"); goto ERROR; -- 2.39.5