Bug 7688

Summary: ash: segmentation fault with substring at negative offset
Product: Busybox Reporter: Ronald Wahl <ronald.wahl>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: major CC: busybox-cvs, vapier
Priority: P5    
Version: 1.22.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Ronald Wahl 2014-12-04 11:31:11 UTC
The following command line will crash ash:

a=;echo ${a:$((0-8192))}

It looks like that there is no sanity check for negative offsets. Furthermore bash looks at the string from behind when using negative offsets. This would be a cool feature. Currently I have to fiddle around to achieve this and the above segmentation fault was the fall-out of my testing.

I tested with 1.21.1 and 1.22.1 both show the issue. Others not checked.
Comment 1 Mike Frysinger 2016-05-26 16:20:32 UTC
*** Bug 8961 has been marked as a duplicate of this bug. ***
Comment 2 Denys Vlasenko 2018-08-04 20:39:34 UTC
Fixed sometime ago