mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdev: Harden against invalid hypervisor data
Reduce chances of unintended side-effects when evaluating hypervisor data which might have been corrupted. Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com> Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
4ca93aa808
commit
a048670bec
@@ -13,6 +13,7 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "sanitize.h"
|
||||
#include "zdev.h"
|
||||
#include "zdev_id.h"
|
||||
|
||||
@@ -69,6 +70,7 @@ static void process_sysinfo(const char *filename)
|
||||
free(substr);
|
||||
} else if (sscanf(line, "VM%*d Control Program: %ms ",
|
||||
&substr) == 1) {
|
||||
sanitize(substr, VALID_CPNAME);
|
||||
array_add(&cps, &num_cps, substr);
|
||||
free(substr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user