xen: Use virStrToLong_i instead of sscanf for XenD port parsing
Parsing is stricter now and doesn't accept trailing characters after the actual value anymore.
This commit is contained in:
parent
82cb2e73aa
commit
57dab74804
@ -4683,7 +4683,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
|
|||||||
else if ((p = strrchr (uri, ':')) != NULL) { /* "hostname:port" */
|
else if ((p = strrchr (uri, ':')) != NULL) { /* "hostname:port" */
|
||||||
int port_nr, n;
|
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,
|
virXendError (conn, VIR_ERR_INVALID_ARG,
|
||||||
"%s", _("xenDaemonDomainMigrate: invalid port number"));
|
"%s", _("xenDaemonDomainMigrate: invalid port number"));
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user