Looking at that code / diff, the test for (size_main > 0) is
insufficient. If we're intending to access the header fields, it's
probably better/safer to test for (size_main > HEADER_SIZE) instead:
Regards, B. Nortmann
diff --git a/fel.c b/fel.c
index de8afad..2fd215a 100644
--- a/fel.c
+++ b/fel.c
@@ -935,7 +935,7 @@ int main(int argc, char **argv)
aw_fel_write_and_execute_spl(handle, buf, size);
// calculate size of (optional) main U-Boot
binary, write it if > 0
int size_main = size - SPL_LEN_LIMIT;
- if (size_main > 0)
+ if (size_main > HEADER_SIZE)
aw_fel_write_uboot_image(handle, buf +
SPL_LEN_LIMIT, size_main);
skip=2;
} else {
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.