Bug 15655

Summary: [busybox 1.36.1] segmentation fault in awk
Product: Busybox Reporter: Frank Busse <f.busse>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Frank Busse 2023-06-22 15:52:54 UTC
The following parameter

$ busybox-1.36.1/bin/busybox" "awk" "-f/"

leads to a segfault in awk, skip_spaces gets a NULL pointer:

#0  0x00005555557c8d6f in skip_spaces (p=p@entry=0x0) at editors/awk.c:826
#1  0x00005555557cc649 in next_token (expected=expected@entry=2146997285) at editors/awk.c:1132
#2  0x00005555557d4a39 in parse_program (p=p@entry=0x0) at editors/awk.c:1720
#3  0x00005555557dc848 in awk_main (argc=<optimized out>, argv=<optimized out>) at editors/awk.c:3660
#4  0x0000555555725260 in run_applet_no_and_exit (applet_no=applet_no@entry=2, name=name@entry=0x7fffffffe699 "awk", argv=argv@entry=0x7fffffffe3b0) at libbb/appletlib.c:969
#5  0x000055555572577d in run_applet_and_exit (name=name@entry=0x7fffffffe699 "awk", argv=argv@entry=0x7fffffffe3b0) at libbb/appletlib.c:988
#6  0x0000555555725752 in busybox_main (argv=0x7fffffffe3b0) at libbb/appletlib.c:916
#7  run_applet_and_exit (name=name@entry=0x7fffffffe691 "busybox", argv=argv@entry=0x7fffffffe3a8) at libbb/appletlib.c:981
#8  0x000055555572589b in main (argc=<optimized out>, argv=0x7fffffffe3a8) at libbb/appletlib.c:1128

(found by KLEE)