mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-10 12:39:22 -04:00
"start" may be legitimately 0x0000
This commit is contained in:
parent
c3d98ed9ca
commit
1d70468b03
@ -485,41 +485,45 @@ do_auto_update(void)
|
|||||||
* now check whether start and end are defined using environment
|
* now check whether start and end are defined using environment
|
||||||
* variables.
|
* variables.
|
||||||
*/
|
*/
|
||||||
start = end = 0;
|
start = -1;
|
||||||
|
end = 0;
|
||||||
env = getenv("firmware_st");
|
env = getenv("firmware_st");
|
||||||
if (env != NULL)
|
if (env != NULL)
|
||||||
start = simple_strtoul(env, NULL, 16);
|
start = simple_strtoul(env, NULL, 16);
|
||||||
env = getenv("firmware_nd");
|
env = getenv("firmware_nd");
|
||||||
if (env != NULL)
|
if (env != NULL)
|
||||||
end = simple_strtoul(env, NULL, 16);
|
end = simple_strtoul(env, NULL, 16);
|
||||||
if (start && end && end > start)
|
if (start >= 0 && end && end > start)
|
||||||
ausize[IDX_FIRMWARE] = (end + 1) - start;
|
ausize[IDX_FIRMWARE] = (end + 1) - start;
|
||||||
start = end = 0;
|
start = -1;
|
||||||
|
end = 0;
|
||||||
env = getenv("kernel_st");
|
env = getenv("kernel_st");
|
||||||
if (env != NULL)
|
if (env != NULL)
|
||||||
start = simple_strtoul(env, NULL, 16);
|
start = simple_strtoul(env, NULL, 16);
|
||||||
env = getenv("kernel_nd");
|
env = getenv("kernel_nd");
|
||||||
if (env != NULL)
|
if (env != NULL)
|
||||||
end = simple_strtoul(env, NULL, 16);
|
end = simple_strtoul(env, NULL, 16);
|
||||||
if (start && end && end > start)
|
if (start >= 0 && end && end > start)
|
||||||
ausize[IDX_KERNEL] = (end + 1) - start;
|
ausize[IDX_KERNEL] = (end + 1) - start;
|
||||||
start = end = 0;
|
start = -1;
|
||||||
|
end = 0;
|
||||||
env = getenv("app_st");
|
env = getenv("app_st");
|
||||||
if (env != NULL)
|
if (env != NULL)
|
||||||
start = simple_strtoul(env, NULL, 16);
|
start = simple_strtoul(env, NULL, 16);
|
||||||
env = getenv("app_nd");
|
env = getenv("app_nd");
|
||||||
if (env != NULL)
|
if (env != NULL)
|
||||||
end = simple_strtoul(env, NULL, 16);
|
end = simple_strtoul(env, NULL, 16);
|
||||||
if (start && end && end > start)
|
if (start >= 0 && end && end > start)
|
||||||
ausize[IDX_APP] = (end + 1) - start;
|
ausize[IDX_APP] = (end + 1) - start;
|
||||||
start = end = 0;
|
start = -1;
|
||||||
|
end = 0;
|
||||||
env = getenv("disk_st");
|
env = getenv("disk_st");
|
||||||
if (env != NULL)
|
if (env != NULL)
|
||||||
start = simple_strtoul(env, NULL, 16);
|
start = simple_strtoul(env, NULL, 16);
|
||||||
env = getenv("disk_nd");
|
env = getenv("disk_nd");
|
||||||
if (env != NULL)
|
if (env != NULL)
|
||||||
end = simple_strtoul(env, NULL, 16);
|
end = simple_strtoul(env, NULL, 16);
|
||||||
if (start && end && end > start)
|
if (start >= 0 && end && end > start)
|
||||||
ausize[IDX_DISK] = (end + 1) - start;
|
ausize[IDX_DISK] = (end + 1) - start;
|
||||||
/* make sure that we see CTRL-C and save the old state */
|
/* make sure that we see CTRL-C and save the old state */
|
||||||
old_ctrlc = disable_ctrlc(0);
|
old_ctrlc = disable_ctrlc(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user