Browse Source
Update uboot_env.c
correct size to data payload size to avoid a read out of bounds
pull/12/head
Manuel Dipolt
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
src/uboot_env.c
|
|
@ -1041,7 +1041,7 @@ static int libuboot_load(struct uboot_ctx *ctx) |
|
|
|
* Search the end of the string pointed by line |
|
|
|
*/ |
|
|
|
for (next = line; *next; ++next) { |
|
|
|
if ((next - (char *)data) > ctx->size) { |
|
|
|
if ((next - (char *)data) > (ctx->size - offsetdata)) { |
|
|
|
free(buf[0]); |
|
|
|
return -EIO; |
|
|
|
} |
|
|
|