Bug 8961 - Bash Compatible sub string of variable when evaluating negative value causes seg fault
Summary: Bash Compatible sub string of variable when evaluating negative value causes ...
Status: RESOLVED DUPLICATE of bug 7688
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.24.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-26 16:20 UTC by Mike Frysinger
Modified: 2016-05-26 16:20 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Frysinger 2016-05-26 16:20:23 UTC
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
Comment 1 Mike Frysinger 2016-05-26 16:20:32 UTC

*** This bug has been marked as a duplicate of bug 7688 ***