Comment 1 for bug 1572060

Revision history for this message
Gavin Panella (allenap) wrote :

The following diff would fix the problem, but test coverage is obviously
needed too:

--- src/maasserver/api/machines.py 2016-04-14 15:25:36 +0000
+++ src/maasserver/api/machines.py 2016-04-19 10:32:03 +0000
@@ -1374,7 +1374,8 @@
                     "text/plain; charset=%s" % settings.DEFAULT_CHARSET))

         # Only available with vmware or msftocs
- port = get_optional_param(request.POST, 'port')
+ port = get_optional_param(
+ request.POST, 'port', validator=validators.Int(min=1, max=65535))
         if port is not None and chassis_type not in ('msftocs', 'vmware'):
             return HttpResponseBadRequest(
                 "port is unavailable with the %s chassis type" %