X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Ffallocate.c;h=bc744f59bc1faf93e74004db1e69e4f457e20141;hb=eb7ec6170eca278fb910e18ca1f7ca81c6b507c0;hp=494743075854fd814555535592c2a3c3fd07d6be;hpb=2ade61d1f864c75ce65c358e4ac8a012a897b89a;p=libguestfs.git diff --git a/daemon/fallocate.c b/daemon/fallocate.c index 4947430..bc744f5 100644 --- a/daemon/fallocate.c +++ b/daemon/fallocate.c @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -31,6 +31,17 @@ int do_fallocate (const char *path, int len) { + if (len < 0) { + reply_with_error ("length < 0"); + return -1; + } + + return do_fallocate64 (path, len); +} + +int +do_fallocate64 (const char *path, int64_t len) +{ int fd; CHROOT_IN;