mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
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" */
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user