SCP: Fix potential NULL pointer dereference (COVERITY)

This commit is contained in:
Mark Pizzolato 2017-03-14 10:24:18 -07:00
parent 9f746cfefa
commit ca19ac921c

2
scp.c
View file

@ -3544,7 +3544,7 @@ else {
result = test_search (&val, &sim_stabr); /* test condition */
}
else { /* Handle memory case */
if (!get_asearch (gbuf, sim_dfdev->dradix, &sim_staba) || /* parse condition */
if (!get_asearch (gbuf, sim_dfdev ? sim_dfdev->dradix : sim_dflt_dev->dradix, &sim_staba) || /* parse condition */
(sim_staba.boolop == -1)) /* relational op reqd */
return SCPE_MISVAL;
reason = get_aval (addr, sim_dfdev, sim_dfunit);/* get data */