From ba8fc5d13ef7bd34da230ef54d60d1d270939575 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 21 Mar 2016 10:58:44 +0100 Subject: [PATCH] limit serial and model and document their real limits The urlencoded format currently cannot check the real decoded length, so we limit to an upper bound and document the real limits. Ideally we'd introduce a decodedLength schema parameter at some point... --- PVE/QemuServer.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index fa8f35e4..fa364ae6 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -620,7 +620,8 @@ my %drivedesc_base = ( type => 'string', format => 'urlencoded', format_description => 'serial', - description => "The drive's reported serial number, url-encoded.", + maxLength => 20*3, # *3 since it's %xx url enoded + description => "The drive's reported serial number, url-encoded, up to 20 bytes long.", optional => 1, } ); @@ -647,7 +648,8 @@ my %model_fmt = ( type => 'string', format => 'urlencoded', format_description => 'model', - description => "The drive's reported model name, url-encoded.", + maxLength => 40*3, # *3 since it's %xx url enoded + description => "The drive's reported model name, url-encoded, up to 40 bytes long.", optional => 1, }, );