]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Merge branch 'maint' into next
authorTheodore Ts'o <tytso@mit.edu>
Mon, 19 Jan 2015 21:37:04 +0000 (16:37 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 19 Jan 2015 21:37:04 +0000 (16:37 -0500)
1  2 
lib/ext2fs/symlink.c
resize/resize2fs.c

index 0732afe4d5ea4bbe753d0d9df88a707b3c01426e,7c485a5fd30406ac111fa3808e87563c9afcd775..279f48b454c29ebb4338639ec162e64e37dc5873
@@@ -91,28 -85,10 +91,28 @@@ errcode_t ext2fs_symlink(ext2_filsys fs
        if (fastlink) {
                /* Fast symlinks, target stored in inode */
                strcpy((char *)&inode.i_block, target);
 +      } else if (inlinelink) {
 +              /* Try inserting an inline data symlink */
 +              inode.i_flags |= EXT4_INLINE_DATA_FL;
 +              retval = ext2fs_write_new_inode(fs, ino, &inode);
 +              if (retval)
 +                      goto cleanup;
 +              retval = ext2fs_inline_data_set(fs, ino, &inode, target,
 +                                              target_len);
 +              if (retval) {
 +                      inode.i_flags &= ~EXT4_INLINE_DATA_FL;
 +                      inlinelink = 0;
 +                      goto need_block;
 +              }
 +              retval = ext2fs_read_inode(fs, ino, &inode);
 +              if (retval)
 +                      goto cleanup;
        } else {
 +need_block:
 +              ext2fs_iblk_set(fs, &inode, 1);
                /* Slow symlinks, target stored in the first block */
                memset(block_buf, 0, fs->blocksize);
-               strcpy(block_buf, target);
+               strncpy(block_buf, target, fs->blocksize);
                if (fs->super->s_feature_incompat &
                    EXT3_FEATURE_INCOMPAT_EXTENTS) {
                        /*
Simple merge