
On 07/30/2014 10:34 PM, John Ferlan wrote:
On 07/28/2014 09:30 AM, Ján Tomko wrote:
We parse the bandwidth rates as unsinged long long, then try to fit them in VIR_TYPED_PARAM_UINT.
Report an error if they exceed UINT_MAX instead of quietly using wrong values.
https://bugzilla.redhat.com/show_bug.cgi?id=1043735 --- tools/virsh-domain.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index ad68aab..f7193cb 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -2686,6 +2686,14 @@ cmdDomIftune(vshControl *ctl, const vshCmd *cmd) vshError(ctl, _("inbound format is incorrect")); goto cleanup; }
I think the parseRateStr() should be modified that way the attach-interface can also make use of this range check as well...
cmdAttachInterface is not limited by this range check - it transmits the value via XML as a string. But I could move the error messages there and use a different maximum for attach-interface. Jan