diff --git a/opal/mca/common/verbs/common_verbs_fake.c b/opal/mca/common/verbs/common_verbs_fake.c index 1b9f65102d..7a7531bc74 100644 --- a/opal/mca/common/verbs/common_verbs_fake.c +++ b/opal/mca/common/verbs/common_verbs_fake.c @@ -82,7 +82,9 @@ static struct ibv_device *fake_driver_init(const char *uverbs_sys_path, value, sizeof(value)) < 0) { return NULL; } - sscanf(value, "%i", &vendor); + if (sscanf(value, "%i", &vendor) != 1) { + return NULL; + } if (vendor == PCI_VENDOR_ID_CISCO) { return &fake_dev;