n_cmd_arg_parse(): FIX token error -> crash, e.g. "-RX 'bind;echo $?' -Xx"..
commit8412796ac1d53570e94748ab96f32d0919908550
authorSteffen Nurpmeso <steffen@sdaoden.eu>
Thu, 2 Aug 2018 21:37:49 +0000 (2 23:37 +0200)
committerSteffen Nurpmeso <steffen@sdaoden.eu>
Thu, 2 Aug 2018 21:58:21 +0000 (2 23:58 +0200)
treea2ecd41065749b71f56f5629544a9b37a8a25fa2
parent46e2ed748098f50e7ab731698723a61a4f648eea
n_cmd_arg_parse(): FIX token error -> crash, e.g. "-RX 'bind;echo $?' -Xx"..

The token segmentation will not push "the empty token following
the bind command", but it will correctly split after the control
operator that the semicolon is.

The problem is that no check is performed in this case to see
whether we would have required some output, or whether the current
argument is "optional".  In this case it is not, and `bind' will
blindly access the first argument, but which does not exist.

This bug exists for quite some time already, grr!
It is likely a leftover from the times when we did not support any
control operator, and when we implemented semicolon, i failed to
update all necessary places.  This was one of them.
cmd-tab.c