aboutsummaryrefslogtreecommitdiff
path: root/qemu-nbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c
index caacf0ed73..108a51f7eb 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -833,9 +833,18 @@ int main(int argc, char **argv)
break;
case 'x':
export_name = optarg;
+ if (strlen(export_name) > NBD_MAX_STRING_SIZE) {
+ error_report("export name '%s' too long", export_name);
+ exit(EXIT_FAILURE);
+ }
break;
case 'D':
export_description = optarg;
+ if (strlen(export_description) > NBD_MAX_STRING_SIZE) {
+ error_report("export description '%s' too long",
+ export_description);
+ exit(EXIT_FAILURE);
+ }
break;
case 'v':
verbose = 1;