[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] network: check negative values in bridge queues



On Mon, Sep 15, 2014 at 10:38:20AM +0200, Erik Skultety wrote:
We already are checking for negative value, reporting an error, but
using wrong function, so the check never succeeds. This patch provides

Actually it could succeed, for example with queues="asdf" or "3d" it
would return a -1.  So I reworded it a bit.

just a minor change in call of the right version of function virStrToLong.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1138539
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a2a7d92..42b8973 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7374,7 +7374,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
        }
        if (queues) {
            unsigned int q;
-            if (virStrToLong_ui(queues, NULL, 10, &q) < 0) {
+            if (virStrToLong_uip(queues, NULL, 10, &q) < 0) {
                virReportError(VIR_ERR_XML_DETAIL,
                               _("'queues' attribute must be positive number: %s"),
                               queues);
--
1.9.3


ACK && Pushed,

Martin

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]