| Summary: | Bash Compatible sub string of variable when evaluating negative value causes seg fault | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Mike Frysinger <vapier> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.24.x | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
When referencing a sub-string of a variable, using a negative value stored in another variable, the shell will seg-fault. Steps to reproduce: / # s=abcdefg / # n=2 / # echo ${s:$n} cdefg / # n=-2 / # echo ${s:$n} Segmentation fault Expected behavior: / # s=abcdefg / # n=2 / # echo ${s:$n} cdefg / # n=-2 / # echo ${s:$n} fg