From: Michael Tremer Date: Fri, 18 Oct 2024 10:44:10 +0000 (+0000) Subject: pakfire: Fail if pakfire_path() is called without the path being set X-Git-Tag: 0.9.30~1020 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d0259e65d5cd06d4d2917174db105d0d7bc7929e;p=pakfire.git pakfire: Fail if pakfire_path() is called without the path being set Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index 17d0a9b07..f1a2694e9 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -999,6 +999,12 @@ int __pakfire_path(struct pakfire* pakfire, char* path, const size_t length, va_list args; int r; + // Check if path is set + if (!*pakfire->path) { + CTX_ERROR(pakfire->ctx, "pakfire_path() called without path being set\n"); + return -ENOTSUP; + } + // Format input into buffer va_start(args, format); r = __pakfire_string_vformat(buffer, sizeof(buffer), format, args);