Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=aef6f49250ee8a... Commit: aef6f49250ee8aa3c6792002f8d5bb81091abd76 Parent: f0b76db91e8346e9abe3ea6fe4b85ffa03998fe3 Author: Andrew Price anprice@redhat.com AuthorDate: Fri Sep 16 15:30:21 2011 +0100 Committer: Bob Peterson rpeterso@redhat.com CommitterDate: Wed Jul 24 10:28:56 2013 -0500
libgfs2: Fix pointer arithmetic in gfs2_quota_change_*
Coverity discovered that a casting precedence error in the pointer arithmetic of gfs2_quota_change_*. This patch fixes the calculations to ensure the correct pointer types are used.
Signed-off-by: Andrew Price anprice@redhat.com --- gfs2/libgfs2/ondisk.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c index 507cebb..e43cd26 100644 --- a/gfs2/libgfs2/ondisk.c +++ b/gfs2/libgfs2/ondisk.c @@ -608,8 +608,8 @@ void gfs2_statfs_change_print(struct gfs2_statfs_change *sc) void gfs2_quota_change_in(struct gfs2_quota_change *qc, struct gfs2_buffer_head *bh) { - struct gfs2_quota_change *str = (struct gfs2_quota_change *)bh->b_data + - sizeof(struct gfs2_meta_header); + struct gfs2_quota_change *str = (struct gfs2_quota_change *)(bh->b_data + + sizeof(struct gfs2_meta_header));
CPIN_64(qc, str, qc_change); CPIN_32(qc, str, qc_flags); @@ -619,8 +619,8 @@ void gfs2_quota_change_in(struct gfs2_quota_change *qc, void gfs2_quota_change_out(struct gfs2_quota_change *qc, struct gfs2_buffer_head *bh) { - struct gfs2_quota_change *str = (struct gfs2_quota_change *)bh->b_data + - sizeof(struct gfs2_meta_header); + struct gfs2_quota_change *str = (struct gfs2_quota_change *)(bh->b_data + + sizeof(struct gfs2_meta_header));
CPOUT_64(qc, str, qc_change); CPOUT_32(qc, str, qc_flags);
cluster-commits@lists.fedorahosted.org