Daniel P. Berrangé 415e022118 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>
2020-03-06 17:02:10 +00:00
..
2019-12-13 14:57:32 +01:00
2020-02-06 13:41:03 +01:00
2020-02-24 23:15:49 +01:00
2019-10-15 11:25:25 +02:00
2020-02-24 23:15:50 +01:00
2019-10-15 11:25:25 +02:00
2019-10-16 12:06:44 +02:00
2020-02-24 23:15:50 +01:00
2019-10-15 11:25:25 +02:00
2020-02-03 19:44:38 +01:00
2019-10-15 11:25:25 +02:00
2018-12-17 17:52:46 +01:00
2019-10-15 11:25:25 +02:00
2019-10-15 11:25:25 +02:00
2020-02-24 23:15:50 +01:00
2020-01-07 16:40:41 +01:00
2019-10-15 11:25:25 +02:00
2019-10-15 11:25:25 +02:00
2019-10-15 11:25:25 +02:00
2020-02-24 23:15:50 +01:00
2020-02-24 23:15:50 +01:00
2020-02-24 23:15:50 +01:00
2019-12-09 14:06:15 +01:00
2019-12-09 14:06:15 +01:00