summaryrefslogtreecommitdiff
path: root/libfdt
diff options
context:
space:
mode:
authorJon Loeliger <jdl@freescale.com>2008-09-25 11:02:17 -0500
committerGerald Van Baren <vanbaren@cideas.com>2008-10-01 22:01:52 -0400
commit741a6d010d09b5bafca8e4cdfb6b2f8a2c07994d (patch)
treee980613007375a209df7a888a0acbc0a6459fea1 /libfdt
parentbbdbc7cb3abefda5bd998edbcf0508fe6256327d (diff)
downloadu-boot-741a6d010d09b5bafca8e4cdfb6b2f8a2c07994d.tar.gz
u-boot-741a6d010d09b5bafca8e4cdfb6b2f8a2c07994d.tar.bz2
u-boot-741a6d010d09b5bafca8e4cdfb6b2f8a2c07994d.zip
Fix an overflow case in fdt_offset_ptr() detected by GCC 4.3.
Using Gcc 4.3 detected this problem: ../dtc/libfdt/fdt.c: In function 'fdt_next_tag': ../dtc/libfdt/fdt.c:82: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false To fix the problem, treat the offset as an unsigned int. The problem report and proposed fix were provided by Steve Papacharalambous <stevep@freescale.com>. Signed-off-by: Jon Loeliger <jdl@freescale.com>
Diffstat (limited to 'libfdt')
-rw-r--r--libfdt/fdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libfdt/fdt.c b/libfdt/fdt.c
index 732103b07b..a59a518b0e 100644
--- a/libfdt/fdt.c
+++ b/libfdt/fdt.c
@@ -78,7 +78,7 @@ int fdt_check_header(const void *fdt)
return 0;
}
-const void *fdt_offset_ptr(const void *fdt, int offset, int len)
+const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
{
const char *p;