diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2016-10-08 08:24:38 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2016-10-08 08:24:38 +0000 |
commit | cfff612229d7a4ed4990223e64e45376f94aefd5 (patch) | |
tree | 94572f8ee3e4c73070c89e859323722de0beb547 /src | |
parent | 9e944ca500a6aadbac604cb0f32e5c7988de6c20 (diff) | |
download | execline-cfff612229d7a4ed4990223e64e45376f94aefd5.tar.xz |
bugfix: tryexec -n segfaulted with empty remainder (thanks muhmuhten)
Diffstat (limited to 'src')
-rw-r--r-- | src/execline/tryexec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/execline/tryexec.c b/src/execline/tryexec.c index 46d3479..0612210 100644 --- a/src/execline/tryexec.c +++ b/src/execline/tryexec.c @@ -39,6 +39,8 @@ int main (int argc, char const **argv, char const *const *envp) int argc1 = el_semicolon(argv) ; if (!argc1) strerr_dief1x(100, "empty block") ; if (argc1 >= argc) strerr_dief1x(100, "unterminated block") ; + if (not && argc1 == argc - 1) + strerr_dief1x(100, "empty remainder not allowed with -n") ; argv[argc1] = 0 ; dom = argv + not * (argc1 + 1) ; sub = argv + !not * (argc1 + 1) ; |