[libvirt] [PATCH] rng: fix port number range validation

Peter Krempa pkrempa at redhat.com
Thu Apr 23 11:16:48 UTC 2015


On Thu, Apr 23, 2015 at 12:15:00 +0100, Daniel Berrange wrote:
> 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 at redhat.com>
> ---
>  docs/schemas/basictypes.rng                                  | 3 ++-
>  tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args | 2 +-
>  tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml  | 2 +-
>  3 files changed, 4 insertions(+), 3 deletions(-)

ACK

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150423/73f9340a/attachment-0001.sig>


More information about the libvir-list mailing list