[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/13] qcow2: Prevent backing file names longer than
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 06/13] qcow2: Prevent backing file names longer than 1023 |
Date: |
Tue, 12 Apr 2016 18:19:01 +0200 |
From: Max Reitz <address@hidden>
We reject backing file names with a length of more than 1023 characters
when opening a qcow2 file, so we should not produce such files
ourselves.
Cc: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 056525c..470734b 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1986,6 +1986,10 @@ static int qcow2_change_backing_file(BlockDriverState
*bs,
{
BDRVQcow2State *s = bs->opaque;
+ if (backing_file && strlen(backing_file) > 1023) {
+ return -EINVAL;
+ }
+
pstrcpy(bs->backing_file, sizeof(bs->backing_file), backing_file ?: "");
pstrcpy(bs->backing_format, sizeof(bs->backing_format), backing_fmt ?: "");
--
1.8.3.1
- [Qemu-devel] [PULL 00/13] Block patches for 2.6, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 02/13] qemu-img: fix formatting of error message, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 03/13] block: initialize qcrypto API at startup, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 05/13] vpc: fix return value check for blk_pwrite, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 04/13] iotests: Make 150 use qemu-img map instead of du, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 07/13] MAINTAINERS: Block layer core, qcow2 and blkdebug, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 08/13] qemu-iotests: check: don't place files with predictable names in /tmp, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 06/13] qcow2: Prevent backing file names longer than 1023,
Kevin Wolf <=
- [Qemu-devel] [PULL 01/13] iotests: fix the broken 026.nocache output, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 10/13] qemu-iotests: iotests.VM: remove qtest socket on error, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 13/13] qemu-iotests: iotests.py: get rid of __all__, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 12/13] qemu-iotests: 068: don't require KVM, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 09/13] qemu-iotests: fix 051 on non-PC architectures, Kevin Wolf, 2016/04/12
- [Qemu-devel] [PULL 11/13] qemu-iotests: 148: properly skip test if quorum support is missing, Kevin Wolf, 2016/04/12
- Re: [Qemu-devel] [PULL 00/13] Block patches for 2.6, Peter Maydell, 2016/04/13