summaryrefslogtreecommitdiffstats
path: root/src/dump.c
diff options
context:
space:
mode:
authorpancake <pancake@flubox>2008-12-19 19:39:27 +0100
committerpancake <pancake@flubox>2008-12-19 19:39:27 +0100
commita6ef73359c0e0537ebf83795ebacbbfaee2c9c28 (patch)
tree1db2cc7c531927be96c581e4077500918ad45ac4 /src/dump.c
parent3a1053b29e5fb8109463259ee9dff3d8f4e4be5b (diff)
download0xFFFF-a6ef73359c0e0537ebf83795ebacbbfaee2c9c28.tar.bz2
* Apply security patches from Erik Hovland - Thanks!
Diffstat (limited to 'src/dump.c')
-rw-r--r--src/dump.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dump.c b/src/dump.c
index e102ce9..3f15fce 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -69,17 +69,14 @@ __rf_extract_exit:
* This function was covardly copied from nanddump.c @ mtd-utils-20060907
*/
#define _GNU_SOURCE
-#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/ioctl.h>
#include <sys/types.h>
-#include <sys/stat.h>
//#include <asm/types.h>
#include <mtd/mtd-user.h>
#ifndef loff_t
@@ -171,6 +168,9 @@ int check_badblocks(char *mtddev)
return 1;
}
+ memset(&stat1, 0, sizeof(stat1));
+ memset(&stat2, 0, sizeof(stat2));
+
fprintf(stderr, "Block size %u, page size %u, OOB size %u\n",
meminfo.erasesize, meminfo.writesize, meminfo.oobsize);
fprintf(stderr, "Size %u, flags %u, type 0x%x\n",
@@ -498,7 +498,7 @@ int dump_config()
break;
if (!memcmp(buf,"ConF", 4)) {
loop:
- read(fd, buf, 4);
+ ret = read(fd, buf, 4);
if (ret == -1) break;
printf("\n0x%08x : ConF %02x %02x %02x %02x : ", i,
buf[0], buf[1], buf[2], buf[3]);