From 1fb6383d76b31c1a4c336bd3ac25edde2193c991 Mon Sep 17 00:00:00 2001 From: Gilles Grandou Date: Thu, 14 Jul 2011 00:13:13 +0200 Subject: [PATCH] fix - block device support was broken... bad pointer dereferencing in ioctl call --- abootimg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/abootimg.c b/abootimg.c index e7c5e9b..7241719 100644 --- a/abootimg.c +++ b/abootimg.c @@ -107,18 +107,18 @@ void abort_printf(char *fmt, ...) } -int blkgetsize(int fd, unsigned long long *bsize) +int blkgetsize(int fd, unsigned long long *pbsize) { # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - return ioctl(fd, DIOCGMEDIASIZE, &bsize); + return ioctl(fd, DIOCGMEDIASIZE, pbsize); # elif defined(__APPLE__) - return ioctl(fd, DKIOCGETBLOCKCOUNT, &bsize); + return ioctl(fd, DKIOCGETBLOCKCOUNT, pbsize); # elif defined(__NetBSD__) // does a suitable ioctl exist? // return (ioctl(fd, DIOCGDINFO, &label) == -1); return 1; # elif defined(__linux__) || defined(__CYGWIN__) - return ioctl(fd, BLKGETSIZE64, &bsize); + return ioctl(fd, BLKGETSIZE64, pbsize); # elif defined(__GNU__) // does a suitable ioctl for HURD exist? return 1;