summaryrefslogtreecommitdiff
path: root/ubi-utils/src/dictionary.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2010-11-03 01:27:24 -0700
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-11-13 13:51:58 +0200
commita3d86d1d7679d082ba2b28b4ad2c57a4dd362df3 (patch)
treeef6b6060bcf85dd4621a3994c4baeec7b32da6b1 /ubi-utils/src/dictionary.c
parentcba5e67f354b16727f2417d63d726ae1cda70733 (diff)
mtd-utils: nandwrite: avoid NULL buffer pointers
Commit 07005d915d6a79dbdee14b0c4360df5058c3a98b made changes to the buffer allocation in nandwrite and did not handle all affected code areas properly. In particular, we were assigning: oob.ptr = noecc ? oobreadbuf : oobbuf; However, since oobreadbuf and oobbuf are declared dynamically, they are NULL at this point. If they aren't properly assigned later, we unwittingly are passing a NULL pointer as oob buffer. This assignment line is best moved after the buffer allocations and pointer assignment. Effects of this problem can be seen when writing oob data with the "-o" flag and without the "-n" flag: $ ./nandwrite -o /dev/mtd0 img.bin Writing data to block 0 at offset 0x0 ioctl(MEMWRITEOOB): Bad address Data was only partially written due to error : Bad address Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/src/dictionary.c')
0 files changed, 0 insertions, 0 deletions