| Anonymous | Login | Signup for a new account | 11-10-2008 10:45 PST |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0000261 | [BusyBox] Other | minor | always | 05-18-05 21:29 | 07-31-05 15:32 | ||||
| Reporter | keithsmith | View Status | public | ||||||
| Assigned To | BusyBox | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | 1.00 | ||||||
| Summary | 0000261: Unsafe empty env var export in ash | ||||||||
| Description |
As reported previously, awk segfaults when empty environment variables are exported. # export x='' # awk SIGSEGV This prompted a bugfix in revision 9054: http://busybox.net/cgi-bin/viewcvs.cgi?view=rev&rev=9054 [^] However, the core problem lies with ash. It maintains the environment as an array of strings of the form 'name=value', but this format is not respected by setvar() as invoked by the export builtin. To demonstrate, note the different results for x and y: ~ # env USER=root HOME=/ LOGNAME=root TERM=vt102 PATH=/usr/sbin:/bin:/usr/bin:/sbin SHELL=/bin/sh PWD=/ # y='' # export y # env USER=root HOME=/ LOGNAME=root TERM=vt102 PATH=/usr/sbin:/bin:/usr/bin:/sbin SHELL=/bin/sh y= PWD=/ # export x='' # env USER=root HOME=/ x LOGNAME=root TERM=vt102 PATH=/usr/sbin:/bin:/usr/bin:/sbin SHELL=/bin/sh y= PWD=/ All entries in the environment should conform to the 'name=value' convention, as any consumers of environment variables set by ash may be susceptible to segfaults similarly to awk. |
||||||||
| Additional Information | Attached patch resolves the issue according to my tests. | ||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
| Copyright © 2000 - 2006 Mantis Group |