mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:03:48 +03:00
cb2a6ef8b5
Currently, an array of libxl_string_list (char **) or in other words, a triple char pointer is initialized. This is dereferenced to a char ** type and stored in serial_list, which is NULL at this point. There is an attempt to reference an element of this serial_list when making a call to libxlMakeChrdevStr which causes a segmentation fault. To fix this, we simply allocate an array of char * instead of libxl_string_list. This patch also adds testcases to extend coverage over both single serial and multiple serial cases. Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>