Re: [PATCH] Btrfs: fix snprintf usage by send's gen_unique_name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 21, 2014 at 11:36:38PM +0000, Filipe David Borba Manana wrote:
> The buffer size argument passed to snprintf must account for the
> trailing null byte added by snprintf, and it returns a value >= then
> sizeof(buffer) when the string can't fit in the buffer.
> 
> Since our buffer has a size of 64 characters, and the maximum orphan
> name we can generate is 63 characters wide, we must pass 64 as the
> buffer size to snprintf, and not 63.
> 
> Signed-off-by: Filipe David Borba Manana <fdmanana@xxxxxxxxx>

JFYI, I have a patch to do the same plus cleans the code around, but
it's part of a bigger series that's in testing atm, so I haven't sent it
yet.

Consider it
Reviewed-by: David Sterba <dsterba@xxxxxxx>

I'll update my version.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux