]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rng: fix port number range validation
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 23 Apr 2015 10:49:23 +0000 (11:49 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 23 Apr 2015 11:59:52 +0000 (12:59 +0100)
commit615bdfda07b7a59125c16ac780762a07d97ef4fe
treeebd6884dca12affa346b8d1725cfd29d9f6ba639
parenteadf41fe313a804409415841a3df0a494470f057
rng: fix port number range validation

The PortNumber data type is declared to derive from 'short'.
Unfortunately this is an signed type, so validates the range
[-32,768, 32,767] which excludes valid port numbers between
32767 and 65535.

We can't use 'unsignedShort', since we need -1 to be a valid
port number too.

This change is to use 'int' and set an explicit max boundary
instead of relying on the data types' built-in max.

One of the existing tests is changed to use a high port number
to validate the schema.

https://bugzilla.redhat.com/show_bug.cgi?id=1214664

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
docs/schemas/basictypes.rng
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml