/*
* cryptsetup-reencrypt - crypt utility for offline re-encryption
*
- * Copyright (C) 2012 Milan Broz All rights reserved.
+ * Copyright (C) 2012, Milan Broz All rights reserved.
* Copyright (C) 2012, Red Hat, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or
log_dbg("Creating empty file %s of size %lu.", new_file, (unsigned long)size);
- if (!(buf = malloc(size)))
+ if (!size || !(buf = malloc(size)))
return -ENOMEM;
memset(buf, 0, size);