From dc013d464000635a5b8ae841c6e683f94a6bee3d Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sun, 12 Mar 2006 01:59:35 +0100 Subject: Add loads of ntohl() in image header handling Patch by Steven Scholz, 10 Jun 2005 --- common/cmd_fdc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/cmd_fdc.c') diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c index 02dffa38e5..03f4ce6d34 100644 --- a/common/cmd_fdc.c +++ b/common/cmd_fdc.c @@ -836,13 +836,13 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } hdr = (image_header_t *)addr; - if (hdr->ih_magic != IH_MAGIC) { + if (ntohl(hdr->ih_magic) != IH_MAGIC) { printf ("Bad Magic Number\n"); return 1; } print_image_hdr(hdr); - imsize= hdr->ih_size+sizeof(image_header_t); + imsize= ntohl(hdr->ih_size)+sizeof(image_header_t); nrofblk=imsize/512; if((imsize%512)>0) nrofblk++; -- cgit