mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-23 05:57:33 +00:00
DM: avoid NULL pointer dereferenced in 'ioc_parse()'
Pointer 'tmp' may be NULL before passing it to 'strtoul()' Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
parent
7a09c81b10
commit
f58fe33687
@ -1043,6 +1043,7 @@ ioc_parse(const char *opts)
|
|||||||
snprintf(virtual_uart_path, sizeof(virtual_uart_path), "%s", param);
|
snprintf(virtual_uart_path, sizeof(virtual_uart_path), "%s", param);
|
||||||
if (tmp != NULL) {
|
if (tmp != NULL) {
|
||||||
tmp = strtok(NULL, ",");
|
tmp = strtok(NULL, ",");
|
||||||
|
if (tmp != NULL)
|
||||||
ioc_boot_reason = strtoul(tmp, 0, 0);
|
ioc_boot_reason = strtoul(tmp, 0, 0);
|
||||||
}
|
}
|
||||||
free(param);
|
free(param);
|
||||||
|
Loading…
Reference in New Issue
Block a user