mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
virsh: vol-upload disallow negative offset
Commit 570d0f63 describes disabling negative offset usage for
vol-upload/download (e.g. cmdVolDownload and cmdVolUpload; however,
the change was only made to cmdVolDownload. There was no change to
cmdVolUpload. This patch adds the same checks for vol-upload.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1087104
Signed-off-by: Shanzhi Yu <shyu@redhat.com>
This commit is contained in:
1 parent
421406808a
commit
cd53d947ef
1 file changed
+3
-3
@@ -677,13 +677,13 @@ cmdVolUpload(vshControl *ctl, const vshCmd *cmd)
|
||||
const char *name = NULL;
|
||||
unsigned long long offset = 0, length = 0;
|
||||
|
||||
if (vshCommandOptULongLongWrap(cmd, "offset", &offset) < 0) {
|
||||
vshError(ctl, _("Unable to parse integer"));
|
||||
if (vshCommandOptULongLong(cmd, "offset", &offset) < 0) {
|
||||
vshError(ctl, _("Unable to parse offset value"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (vshCommandOptULongLongWrap(cmd, "length", &length) < 0) {
|
||||
vshError(ctl, _("Unable to parse integer"));
|
||||
vshError(ctl, _("Unable to parse length value"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user