Avoid crashing when BURST has missing modes.
authorMichael Poole <mdpoole@troilus.org>
Sun, 20 May 2007 15:59:43 +0000 (11:59 -0400)
committerMichael Poole <mdpoole@troilus.org>
Mon, 28 May 2007 18:46:32 +0000 (14:46 -0400)
src/proto-p10.c (cmd_burst): If the expected number of modes is larger
  than the actual number, only unsplit and advance by the actual number.

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;