BusyBox Bug and Patch Tracking
BusyBox
  

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

- Relationships

- Notes
(0001097)
landley
02-14-06 08:06

svn 14013
 

- Issue History
Date Modified Username Field Change
01-13-06 17:22 akvadrako New Issue
01-13-06 17:22 akvadrako Status new => assigned
01-13-06 17:22 akvadrako Assigned To  => BusyBox
02-14-06 08:06 landley Status assigned => closed
02-14-06 08:06 landley Note Added: 0001097
02-14-06 08:06 landley Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker