Jamie Ryu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/75733?usp=email )
Change subject: drivers/wwan/fm: Fix format string vulnerability with snprintf ......................................................................
drivers/wwan/fm: Fix format string vulnerability with snprintf
This fixes format string vulnerability issues with snprintf statement found by klocwork scan.
Foundby=klocwork BUG=NONE TEST=Boot to OS on Meteor Lake rex platform and run klocwork
Signed-off-by: Jamie Ryu jamie.m.ryu@intel.com Change-Id: Ia6b7d70c0b2b86d0918e58348dccd206a7ee9193 --- M src/drivers/wwan/fm/acpi_fm350gl.c 1 file changed, 8 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/75733/1
diff --git a/src/drivers/wwan/fm/acpi_fm350gl.c b/src/drivers/wwan/fm/acpi_fm350gl.c index 46f8ecb..139fd15 100644 --- a/src/drivers/wwan/fm/acpi_fm350gl.c +++ b/src/drivers/wwan/fm/acpi_fm350gl.c @@ -62,8 +62,8 @@
rtd3_config = config_of(config->rtd3dev); if (rtd3_config->use_rp_mutex) { - snprintf(mutex_path, sizeof(mutex_path), acpi_device_path_join(parent_dev, - RP_MUTEX_NAME)); + snprintf(mutex_path, sizeof(mutex_path), "%s", + acpi_device_path_join(parent_dev, RP_MUTEX_NAME)); /* Acquire root port mutex in case FHRF is called directly and not called from _RST */ acpigen_write_acquire(mutex_path, ACPI_MUTEX_NO_TIMEOUT); } @@ -129,8 +129,8 @@
rtd3_config = config_of(config->rtd3dev); if (rtd3_config->use_rp_mutex) { - snprintf(mutex_path, sizeof(mutex_path), acpi_device_path_join(parent_dev, - RP_MUTEX_NAME)); + snprintf(mutex_path, sizeof(mutex_path), "%s", + acpi_device_path_join(parent_dev, RP_MUTEX_NAME)); /* Acquire root port mutex */ acpigen_write_acquire(mutex_path, ACPI_MUTEX_NO_TIMEOUT); } @@ -184,8 +184,8 @@
rtd3_config = config_of(config->rtd3dev); if (rtd3_config->use_rp_mutex) { - snprintf(mutex_path, sizeof(mutex_path), acpi_device_path_join(parent_dev, - RP_MUTEX_NAME)); + snprintf(mutex_path, sizeof(mutex_path), "%s", + acpi_device_path_join(parent_dev, RP_MUTEX_NAME)); /* Acquire root port mutex */ acpigen_write_acquire(mutex_path, ACPI_MUTEX_NO_TIMEOUT); } @@ -219,8 +219,8 @@
rtd3_config = config_of(config->rtd3dev); if (rtd3_config->use_rp_mutex) { - snprintf(mutex_path, sizeof(mutex_path), acpi_device_path_join(parent_dev, - RP_MUTEX_NAME)); + snprintf(mutex_path, sizeof(mutex_path), "%s", + acpi_device_path_join(parent_dev, RP_MUTEX_NAME)); /* Acquire root port mutex */ acpigen_write_acquire(mutex_path, ACPI_MUTEX_NO_TIMEOUT); }