From: Eric Sandeen <sandeen@redhat.com>
To: xfs-oss <xfs@oss.sgi.com>
Subject: xfs_repair: Fix malloc size of rt_ext_tree_ptr (harmless)
Date: Fri, 31 Jul 2015 23:01:59 -0700 [thread overview]
Message-ID: <55BC60D7.4020102@redhat.com> (raw)
rt_ext_tree_ptr points to an avl64tree_desc_t, but we malloc memory
according to the size of avltree_desc_t. Oddly, the latter happens
to be larger, so we're ok, but may as well make it correct.
Addresses-Coverity-Id: 1297533
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
Hm, I thought I sent this already, but don't see it on the list.
diff --git a/repair/incore_ext.c b/repair/incore_ext.c
index 826bf44..6611d5c 100644
--- a/repair/incore_ext.c
+++ b/repair/incore_ext.c
@@ -783,7 +783,7 @@ incore_ext_init(xfs_mount_t *mp)
avl_init_tree(extent_bcnt_ptrs[i], &avl_extent_bcnt_tree_ops);
}
- if ((rt_ext_tree_ptr = malloc(sizeof(avltree_desc_t))) == NULL)
+ if ((rt_ext_tree_ptr = malloc(sizeof(avl64tree_desc_t))) == NULL)
do_error(_("couldn't malloc dup rt extent tree descriptor\n"));
avl64_init_tree(rt_ext_tree_ptr, &avl64_extent_tree_ops);
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2015-08-01 6:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-01 6:01 Eric Sandeen [this message]
2015-08-02 17:32 ` [PATCH] xfs_repair: Fix malloc size of rt_ext_tree_ptr (harmless) Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55BC60D7.4020102@redhat.com \
--to=sandeen@redhat.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox