mkfs: avoid heap-buffer-read-underrun for zero-length "size" arg
authorJim Meyering <meyering@redhat.com>
Fri, 20 Apr 2012 19:27:26 +0000 (21:27 +0200)
committerHugo Mills <hugo@carfax.org.uk>
Tue, 5 Jun 2012 18:56:20 +0000 (19:56 +0100)
commit8ad8e789fc03423a9f1d33051b592419399184bb
treedc577d4651138bca17253e6982472505c6d2a2c9
parent54e345b5c2339dee170595f686dbd26937620262
mkfs: avoid heap-buffer-read-underrun for zero-length "size" arg

* mkfs.c (parse_size): ./mkfs.btrfs -A '' would read and possibly
write the byte before beginning of strdup'd heap buffer.  All other
size-accepting options were similarly affected.

Reviewed-by: Josef Bacik <josef@redhat.com>
cmds-subvolume.c
mkfs.c