aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-11-14 21:12:16 -0500
committerMike Frysinger <vapier@gentoo.org>2016-11-14 21:12:16 -0500
commit743d4fe35a8d6029bc0da10b5b3d9f095a07f2c1 (patch)
tree55d61030b25a8f82d156fd2e19a951d85f4457dc
parenthuman_readable: resync with upstream busybox #590932 (diff)
downloadportage-utils-743d4fe35a8d6029bc0da10b5b3d9f095a07f2c1.tar.gz
portage-utils-743d4fe35a8d6029bc0da10b5b3d9f095a07f2c1.tar.bz2
portage-utils-743d4fe35a8d6029bc0da10b5b3d9f095a07f2c1.zip
qpkg: fix bad pointer passing
Taking an address of a stack buffer doesn't do what we want. Create a local variable to hold the address to pass down. URL: https://bugs.gentoo.org/598974 Reported-by: Alexander Wetzel <alexander.wetzel@web.de>
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index e9e65b46..f6e51844 100644
--- a/main.c
+++ b/main.c
@@ -1356,6 +1356,7 @@ _q_static queue *get_vdb_atoms(int fullcpv)
char buf[_Q_PATH_MAX];
char slot[_Q_PATH_MAX];
+ char *slotp = slot;
size_t slot_len;
struct dirent **cat;
@@ -1384,7 +1385,7 @@ _q_static queue *get_vdb_atoms(int fullcpv)
* until this is rewritten & merged into libq/vdb.c. */
slot_len = sizeof(slot);
strncat(buf, "/SLOT", sizeof(buf));
- eat_file_at(ctx->vdb_fd, buf, (char **)&slot, &slot_len);
+ eat_file_at(ctx->vdb_fd, buf, &slotp, &slot_len);
rmspace(slot);
if (fullcpv) {