https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=175314
Kyle Evans <bsdpo...@kyle-evans.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bsdpo...@kyle-evans.net --- Comment #1 from Kyle Evans <bsdpo...@kyle-evans.net> --- Created attachment 179167 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=179167&action=edit Proposed patch to address bsdgrep abusing memory This was irritating to track down. There were two major problems here: 1.) wescmap was being built on top of uninitialized memory -- therefore, every dot was theoretically escaped with junk=true 2.) The pre-processed pattern never makes it to fg->pattern, so escmap (also uninitialized memory) was being built based on the processed pattern (without escapes) This caused mass-hilarity and there's no way this could have worked since import. Attached patch addresses both issues by switching both xmalloc()'s to xcalloc and making a copy of the original pat (sans start marker at least) to examine for escapes. I also touched formatting a bit in the area that I had to make more changes to, because it was difficult to parse through at first. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ freebsd-bugs@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"