From: Nathan Scott Date: Thu, 13 Dec 2001 09:18:24 +0000 (+0000) Subject: Fixes a problem from the last bugfix checkin, picked up by QA on fuzzy. X-Git-Tag: v2.0.0~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d561e1d5849b0734efa55fb12a6e4d49786e1f7c;p=thirdparty%2Fxfsprogs-dev.git Fixes a problem from the last bugfix checkin, picked up by QA on fuzzy. Since sb_dirblklog is only 8bits long, we can no longer use a pointer to an integer when looking for non-zero memory - this gives alignment issues and takes us past the end of our dynamically allocated memory. Chalk one up to QA and electric fence. --- diff --git a/repair/agheader.c b/repair/agheader.c index 36b4b37ed..61590147a 100644 --- a/repair/agheader.c +++ b/repair/agheader.c @@ -218,7 +218,7 @@ secondary_sb_wack(xfs_mount_t *mp, xfs_buf_t *sbuf, xfs_sb_t *sb, { int do_bzero; int size; - int *ip; + char *ip; int rval; rval = do_bzero = 0; @@ -247,8 +247,8 @@ secondary_sb_wack(xfs_mount_t *mp, xfs_buf_t *sbuf, xfs_sb_t *sb, else size = (__psint_t)&sb->sb_width + sizeof(sb->sb_width) - (__psint_t)sb; - for (ip = (int *)((__psint_t)sb + size); - ip < (int *)((__psint_t)sb + mp->m_sb.sb_sectsize); + for (ip = (char *)((__psint_t)sb + size); + ip < (char *)((__psint_t)sb + mp->m_sb.sb_sectsize); ip++) { if (*ip) { do_bzero = 1;