Avoid crashing when BURST has missing modes.
[srvx.git] / src / proto-p10.c
index 85bb122fa310e6d6721cef37149c2f908cd1f685..003bbe62999cf23eb3a7312a99dd9c1f145cba88 100644 (file)
@@ -1231,6 +1231,8 @@ static CMD_FUNC(cmd_burst)
                 if ((*pos == 'k') || (*pos == 'l') || (*pos == 'A')
                     || (*pos == 'U'))
                     n_modes++;
+            if (next + n_modes > argc)
+                n_modes = argc - next;
             unsplit_string(argv+next, n_modes, modes);
             next += n_modes;
             break;