"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

boot: pxe: Prevent evaluation of uninitialised variable

In the case where parse_sliteral returns an error then label_name
will not have been assigned to. In order to prevent evaluating
label_name in this case add a check for the return value of parse_sliteral.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>

authored by

Andrew Goodbody and committed by
Tom Rini
c3b43eea 0ffd4565

+2 -2
+2 -2
boot/pxe_utils.c
··· 1348 1348 case T_ONTIMEOUT: 1349 1349 err = parse_sliteral(&p, &label_name); 1350 1350 1351 - if (label_name) { 1351 + if (err >= 0 && label_name) { 1352 1352 if (cfg->default_label) 1353 1353 free(cfg->default_label); 1354 1354 ··· 1360 1360 case T_FALLBACK: 1361 1361 err = parse_sliteral(&p, &label_name); 1362 1362 1363 - if (label_name) { 1363 + if (err >= 0 && label_name) { 1364 1364 if (cfg->fallback_label) 1365 1365 free(cfg->fallback_label); 1366 1366