projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
24fa0e5
)
fdt: Check error codes returned from fdtlib when loading ITB
author
Joe Hershberger
<joe.hershberger@ni.com>
Fri, 17 Aug 2012 10:34:35 +0000
(10:34 +0000)
committer
Gerald Van Baren
<gvb@unssw.com>
Mon, 15 Oct 2012 23:20:08 +0000
(19:20 -0400)
Before this patch, error codes returned from fdtlib were ignored and
continued access would cause a crash. Now just check if the image is
truncated and error if so.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
common/image.c
patch
|
blob
|
history
diff --git
a/common/image.c
b/common/image.c
index
f084d2b
..
852a96f
100644
(file)
--- a/
common/image.c
+++ b/
common/image.c
@@
-2820,6
+2820,11
@@
int fit_image_check_hashes(const void *fit, int image_noffset)
}
}
+ if (noffset == -FDT_ERR_TRUNCATED || noffset == -FDT_ERR_BADSTRUCTURE) {
+ err_msg = " error!\nCorrupted or truncated tree";
+ goto error;
+ }
+
return 1;
error: