commit:     743d4fe35a8d6029bc0da10b5b3d9f095a07f2c1
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 15 02:12:16 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Nov 15 02:12:16 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=743d4fe3

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 <AT> web.de>

 main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c
index e9e65b4..f6e5184 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) {

Reply via email to