From: Michael Poole Date: Sun, 20 May 2007 15:59:43 +0000 (-0400) Subject: Avoid crashing when BURST has missing modes. X-Git-Tag: v1.4.0-rc1~21 X-Git-Url: http://git.pk910.de/?p=srvx.git;a=commitdiff_plain;h=bc8461e95aafc26b36ee41ca66ff5aabfb6d728f Avoid crashing when BURST has missing modes. 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. --- diff --git a/src/proto-p10.c b/src/proto-p10.c index 85bb122..003bbe6 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -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;