mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
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>
This commit is contained in:
committed by
Tom Rini
parent
0ffd456516
commit
c3b43eeaea
@@ -1348,7 +1348,7 @@ static int parse_pxefile_top(struct pxe_context *ctx, char *p, unsigned long bas
|
||||
case T_ONTIMEOUT:
|
||||
err = parse_sliteral(&p, &label_name);
|
||||
|
||||
if (label_name) {
|
||||
if (err >= 0 && label_name) {
|
||||
if (cfg->default_label)
|
||||
free(cfg->default_label);
|
||||
|
||||
@@ -1360,7 +1360,7 @@ static int parse_pxefile_top(struct pxe_context *ctx, char *p, unsigned long bas
|
||||
case T_FALLBACK:
|
||||
err = parse_sliteral(&p, &label_name);
|
||||
|
||||
if (label_name) {
|
||||
if (err >= 0 && label_name) {
|
||||
if (cfg->fallback_label)
|
||||
free(cfg->fallback_label);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user