aboutsummaryrefslogtreecommitdiff
path: root/ext2fs
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-10-08 18:25:13 +0200
committerRichard Braun <rbraun@sceen.net>2017-01-06 20:36:09 +0100
commit4490e9a08367c7af617358de5b85ae7ab5198278 (patch)
tree412c183e4ae29a36fc73e405472d91bc717dc215 /ext2fs
parent4818346b39b5a58962d1676ea0bb3a0b954c1fed (diff)
downloadhurd-4490e9a08367c7af617358de5b85ae7ab5198278.tar.gz
hurd-4490e9a08367c7af617358de5b85ae7ab5198278.tar.bz2
hurd-4490e9a08367c7af617358de5b85ae7ab5198278.zip
ext2fs: Fix block allocation.
* ext2fs/xattr.c (ext2_set_xattr): Check returned block number before mapping it.
Diffstat (limited to 'ext2fs')
-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);