From: Emil Velikov Date: Wed, 4 Jun 2025 16:16:25 +0000 (+0100) Subject: libkmod: don't use %m on strbuf_to_vector() failure X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a6217da17e0a9baee74a59b14d7c67578928b7e7;p=thirdparty%2Fkmod.git libkmod: don't use %m on strbuf_to_vector() failure The function does not set the errno on overflow conditions, so the ERR() will produce (somewhat) arbitrary strerror. Similar to other places throughout the code base - just use ENOMEM. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/368 Signed-off-by: Lucas De Marchi --- diff --git a/libkmod/libkmod-builtin.c b/libkmod/libkmod-builtin.c index f54d876b..f1b836a9 100644 --- a/libkmod/libkmod-builtin.c +++ b/libkmod/libkmod-builtin.c @@ -167,7 +167,7 @@ ssize_t kmod_builtin_get_modinfo(struct kmod_ctx *ctx, const char *modname, *modinfo = strbuf_to_vector(&buf, (size_t)count); if (*modinfo == NULL) { count = -ENOMEM; - ERR(ctx, "strbuf_to_vector: %m\n"); + ERR(ctx, "strbuf_to_vector: %s\n", strerror(ENOMEM)); } }