aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 37d1afb839..df3aefd35a 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -371,12 +371,15 @@ static int add_old_style_options(const char *fmt, QemuOpts *opts,
static int64_t cvtnum(const char *s)
{
int err;
- int64_t value;
+ uint64_t value;
err = qemu_strtosz(s, NULL, &value);
if (err < 0) {
return err;
}
+ if (value > INT64_MAX) {
+ return -ERANGE;
+ }
return value;
}