From 72cbc7b243326be13f986dd160e7e69a38d5b869 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 17 Jun 2023 16:07:28 -0400 Subject: opk/write: Fix temporary archive file name buffer --- (limited to 'src/opk') diff --git a/src/opk/write.c b/src/opk/write.c index 2986ae0..3880552 100644 --- a/src/opk/write.c +++ b/src/opk/write.c @@ -509,7 +509,7 @@ opkg_opk_opk_write(struct opkg_opk_opk *opk, const char *file_name) /* Allocate temporary archive file name buffer. */ opk->temp_file_name = - malloc(sizeof(file_name) + sizeof("~control.tar.gz")); + malloc(strlen(file_name) + strlen("~control.tar.gz") + 1); if (opk->temp_file_name == NULL) { ret = OPKG_OPK_ERROR; goto out4; -- cgit v0.9.1