mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 17:18:59 +00:00
4c60a6f803
When the same package file is specified multiple times on the opkg install command line, the name pointer on the argv array becomes stale after the package structures have been merged, leading to invalid memory accesses upon install. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
12 lines
256 B
Diff
12 lines
256 B
Diff
--- a/libopkg/opkg_download.c
|
|
+++ b/libopkg/opkg_download.c
|
|
@@ -335,7 +335,7 @@ opkg_prepare_url_for_install(const char
|
|
hash_insert_pkg(pkg, 1);
|
|
|
|
if (namep) {
|
|
- *namep = pkg->name;
|
|
+ *namep = xstrdup(pkg->name);
|
|
}
|
|
return 0;
|
|
}
|