]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
xen: Use virStrToLong_i instead of sscanf for XenD port parsing
authorMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 30 Mar 2010 14:52:42 +0000 (16:52 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 1 Apr 2010 10:53:41 +0000 (12:53 +0200)
Parsing is stricter now and doesn't accept trailing characters
after the actual value anymore.

src/xen/xend_internal.c

index 0649d23a375766978d974e8900220e65ef1d157f..691a940bd38ad91014ea7e557f1f2e05d1c1d9c9 100644 (file)
@@ -4683,7 +4683,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
     else if ((p = strrchr (uri, ':')) != NULL) { /* "hostname:port" */
         int port_nr, n;
 
-        if (sscanf (p+1, "%d", &port_nr) != 1) {
+        if (virStrToLong_i(p+1, NULL, 10, &port_nr) < 0) {
             virXendError (conn, VIR_ERR_INVALID_ARG,
                           "%s", _("xenDaemonDomainMigrate: invalid port number"));
             return -1;