summaryrefslogtreecommitdiff
path: root/ext2fs/xattr.c
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-10-08 18:25:13 +0200
committerJustus Winter <justus@gnupg.org>2016-11-10 15:31:02 +0100
commit55d048463e7997197db2caf3c537207f3b0de203 (patch)
treec419e000a76722699a127a9babf851db9c623b97 /ext2fs/xattr.c
parentff2229cc89f18429c1709f122203c13845a4de89 (diff)
ext2fs: Fix block allocation.
* ext2fs/xattr.c (ext2_set_xattr): Check returned block number before mapping it.
Diffstat (limited to 'ext2fs/xattr.c')
-rw-r--r--ext2fs/xattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext2fs/xattr.c b/ext2fs/xattr.c
index 41e8c89c..c5771fe0 100644
--- a/ext2fs/xattr.c
+++ b/ext2fs/xattr.c
@@ -704,7 +704,6 @@ ext2_set_xattr (struct node *np, const char *name, const char *value,
goal = sblock->s_first_data_block + np->dn->info.i_block_group *
EXT2_BLOCKS_PER_GROUP (sblock);
blkno = ext2_new_block (goal, 0, 0, 0);
- block = disk_cache_block_ref (blkno);
if (blkno == 0)
{
@@ -712,6 +711,7 @@ ext2_set_xattr (struct node *np, const char *name, const char *value,
goto cleanup;
}
+ block = disk_cache_block_ref (blkno);
memset (block, 0, block_size);
header = EXT2_XATTR_HEADER (block);