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
parent
commit
f21be93936
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/uboot_env.c

2
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 * Search the end of the string pointed by line
*/ */
for (next = line; *next; ++next) { for (next = line; *next; ++next) {
if ((next - (char *)data) > ctx->size) { if ((next - (char *)data) > (ctx->size - offsetdata)) {
free(buf[0]); free(buf[0]);
return -EIO; return -EIO;
} }

Loading…
Cancel
Save