kopia lustrzana https://github.com/stlink-org/stlink
Add null check for return value of stlink_chipid_get_params()
Pass a null pointer to "%s" is undefined behaviour.pull/1307/head
rodzic
8de2b4dcfa
commit
98902c271e
|
@ -591,7 +591,8 @@ int main(int argc, char **argv) {
|
|||
if (!(stlink->chip_flags & CHIP_F_HAS_SWO_TRACING)) {
|
||||
const struct stlink_chipid_params *params =
|
||||
stlink_chipid_get_params(stlink->chip_id);
|
||||
ELOG("We do not support SWO output for device '%s'\n", params->dev_type);
|
||||
ELOG("We do not support SWO output for device '%s'\n",
|
||||
params ? params->dev_type : "");
|
||||
if (!settings.force)
|
||||
return APP_RESULT_STLINK_UNSUPPORTED_DEVICE;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue