From: Michael Tremer Date: Fri, 9 Dec 2022 16:27:52 +0000 (+0000) Subject: repo: Avoid reading past the end of the key buffer X-Git-Tag: 0.9.28~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed12b4f709617026c581edb0b4294d82d781ac39;p=pakfire.git repo: Avoid reading past the end of the key buffer Signed-off-by: Michael Tremer --- 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;