tag 581867 + patch fixed-upstream
thanks

Jonny dixit:

>segmentation fault is obtained according to the following procedure:
> $ set 0
> $ echo ${*:0}
> Segmentation fault

Thanks a lot for reporting; this is fixed in upstream now:

t...@blau:~ $ print $KSH_VERSION
@(#)MIRBSD KSH R39 2010/05/16
t...@blau:~ $ set 0
t...@blau:~ $ echo ${*:0}
/bin/mksh: ${*: 0}: bad substitution
1|t...@blau:~ $ echo $?
1

>Severity: important

Is this severity justified? The fix will be disabling this idiom
anyway ($* is a vector, like $@, just expanded differently; to
trim it you must assign it to a string beforehand; this was al-
ways the case with things like ${foo#bar} and has merely been
overseen during addition of the ${foo:bar} and ${foo/bar} trim
operations), and I would like to not do a new upload to Debian
right now (there will be a new upstream release soonish anyway,
but I’ll need to dig through some more Austin mailing list posts
first to see if anything else needs fixing first).

If you don’t reply I will downgrade the severity. ETA for the
new upload is probably a month at best unless real life keeps
me this busy as it is right now.

For your convenience, I have attached the patch.

bye,
//mirabilos
-- 
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh
Index: src/bin/mksh/eval.c
diff -up src/bin/mksh/eval.c:1.87 src/bin/mksh/eval.c:1.88
--- src/bin/mksh/eval.c:1.87    Tue Apr 20 09:10:07 2010
+++ src/bin/mksh/eval.c Sun May 16 19:04:41 2010
@@ -1020,6 +1020,8 @@ varsub(Expand *xp, const char *sp, const
                case '=':       /* can't assign to a vector */
                case '%':       /* can't trim a vector (yet) */
                case '#':
+               case '0':
+               case '/':
                        return (-1);
                }
                if (e->loc->argc == 0) {

Reply via email to