[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/5] qemu-img: remove check that cvtnum value > MAX_INT
From: |
Eyal Moscovici |
Subject: |
[PATCH v2 1/5] qemu-img: remove check that cvtnum value > MAX_INT |
Date: |
Thu, 7 May 2020 00:34:55 +0300 |
Following commit f46bfdbfc8f95cf65d7818ef68a801e063c40332 (util/cutils: Change
qemu_strtosz*() from int64_t to uint64_t) which added a similar check to
cvtnum. As a result there is no need to check it separately outside of cvtnum.
Acked-by: Mark Kanda <address@hidden>
Signed-off-by: Eyal Moscovici <address@hidden>
---
qemu-img.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 6a4327aaba..116a9c6349 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4307,7 +4307,7 @@ static int img_bench(int argc, char **argv)
int64_t sval;
sval = cvtnum(optarg);
- if (sval < 0 || sval > INT_MAX) {
+ if (sval < 0) {
error_report("Invalid buffer size specified");
return 1;
}
@@ -4320,7 +4320,7 @@ static int img_bench(int argc, char **argv)
int64_t sval;
sval = cvtnum(optarg);
- if (sval < 0 || sval > INT_MAX) {
+ if (sval < 0) {
error_report("Invalid step size specified");
return 1;
}
@@ -4493,7 +4493,7 @@ static int img_dd_bs(const char *arg,
res = cvtnum(arg);
- if (res <= 0 || res > INT_MAX) {
+ if (res <= 0) {
error_report("invalid number: '%s'", arg);
return 1;
}
--
2.17.2 (Apple Git-113)
- [PATCH v2 0/5] Additional parameters for qemu_img map, Eyal Moscovici, 2020/05/06
- [PATCH v2 1/5] qemu-img: remove check that cvtnum value > MAX_INT,
Eyal Moscovici <=
- [PATCH v2 2/5] qemu_img: add error report to cvtnum, Eyal Moscovici, 2020/05/06
- [PATCH v2 3/5] qemu-img: validate image length in img_map, Eyal Moscovici, 2020/05/06
- [PATCH v2 4/5] qemu-img: refactor dump_map_entry JSON format output, Eyal Moscovici, 2020/05/06
- [PATCH v2 5/5] qemu-img: Add --start-offset and --max-length to map, Eyal Moscovici, 2020/05/06