[libvirt] [PATCH v2] completer: Doesn't alloc enough space for null terminated array of strings

Michal Privoznik mprivozn at redhat.com
Thu Jul 12 14:04:12 UTC 2018


On 07/12/2018 04:00 PM, Simon Kobyda wrote:
> Functions virshSecretEventNameCompleter, virshPoolEventNameCompleter,
> virshNodedevEventNameCompleter allocates only enough space
> for array of N strings.
> 
> However these are null terminated strings, so program needs to
> alloc space for array of N+1 strings.
> 
> How to replicate error: valgrind virsh, use completer for
> '-nodedev-event --event' or '-pool-event --event' or
> '-secret-event --event'.

Well, "-nodedev-event" is not a command, "nodedev-event" is ;-)

I'll fix these before pushing.

> 
> Signed-off-by: Simon Kobyda <skobyda at redhat.com>
> 
> ---
> 
> Changes in V2:
>     - Added "Signed-off-by"
>     - Changed format of commit message to make it more
>     readable
> 
>  tools/virsh-completer.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)


ACKed and pushed.

Congratulations on your first libvirt contribution!

Michal




More information about the libvir-list mailing list