| Anonymous | Login | Signup for a new account | 11-10-2008 10:55 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 | ||||
| 0000642 | [BusyBox] Other | minor | always | 01-13-06 17:22 | 02-14-06 08:06 | ||||
| Reporter | akvadrako | View Status | public | ||||||
| Assigned To | BusyBox | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | svn | ||||||
| Summary | 0000642: support NUL input bytes in awk | ||||||||
| Description |
Currently awk breaks when givin a NUL input byte because it uses strchr() to find the end of a record. Since the NUL's hide the newlines, the record buffer grows until awk runs out of memory. Using memchr instead avoids this problem. Additionally, pattern matches fail with embeded NUL's because regexec() uses a NUL-terminated string. The best we can do to avoid this is treat NUL as a record seperator. Behavior with NUL's is left undefined by SUSv3, but I believe this is the most useful implementation. |
||||||||
| Additional Information |
--- busybox/editors/awk.c 2005-08-16 18:29:16.000000000 -0700 +++ busybox/editors/awk.c 2006-01-13 17:15:08.000000000 -0800 @@ -1668,6 +1668,8 @@ } } else if (c != '\0') { s = strchr(b+pp, c); + if(! s) + s = memchr(b+pp, '\0', p - pp); if (s) { so = eo = s-b; eo++; |
||||||||
| Attached Files | |||||||||
|
|
|||||||||
| Copyright © 2000 - 2006 Mantis Group |