Skip to content
Snippets Groups Projects
Commit 4c60a6f8 authored by Jo-Philipp Wich's avatar Jo-Philipp Wich
Browse files

opkg: fix use-after-free with duplicate packages on the command line


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: default avatarJo-Philipp Wich <jo@mein.io>
parent b9466382
No related branches found
No related tags found
No related merge requests found
#
# Copyright (C) 2006-2015 OpenWrt.org
# Copyright (C) 2016 LEDE Project
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
......@@ -12,7 +13,7 @@ include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=opkg
PKG_REV:=9c97d5ecd795709c8584e972bfdf3aee3a5b846d
PKG_VERSION:=$(PKG_REV)
PKG_RELEASE:=12
PKG_RELEASE:=13
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=$(PKG_REV)
......
--- 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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment