diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2020-03-05 15:42:53 +0000 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2020-03-06 17:02:10 +0000 |
commit | 415e022118fc0f8acb31ca55bc57e64c5a9acf64 (patch) | |
tree | c6392152060f9d60df833af1bc242c9051450f90 /tests/virsh-auth.xml | |
parent | c04e25b66c2967516b41e260dedabe6f2a86d66f (diff) | |
download | libvirt-415e022118fc0f8acb31ca55bc57e64c5a9acf64.tar.gz |
src: fix mixup of stack and heap allocated data in auth callback
In the following recent change:
commit db72866310d1e520efa8ed2d4589bdb5e76a1c95
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Tue Jan 14 10:40:52 2020 +0000
util: add API for reading password from the console
the fact that "bufptr" pointer may point to either heap or stack
allocated data was overlooked. As a result, when the strdup was
removed, we ended up returning a pointer to the local stack to
the caller. When the caller referenced this stack pointer they
got out garbage which fairly quickly resulted in a crash.
We need to copy the stack buffer into heap memory in the username
case.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'tests/virsh-auth.xml')
-rw-r--r-- | tests/virsh-auth.xml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/virsh-auth.xml b/tests/virsh-auth.xml new file mode 100644 index 0000000000..a045a0746e --- /dev/null +++ b/tests/virsh-auth.xml @@ -0,0 +1,5 @@ +<node> + <auth> + <user>astrochicken</user> + </auth> +</node> |