Re: [PATCH v2] grep: provide sane default to grep_source struct

2019-05-21 Thread Jonathan Nieder
Hi, Emily Shaffer wrote: > On Thu, May 16, 2019 at 06:02:54PM -0400, Jeff King wrote: >> On Thu, May 16, 2019 at 02:44:44PM -0700, Emily Shaffer wrote: >>> + /* TODO: In the future it may become desirable to pass in the name as >>> +* an argument to grep_buffer(). At that time, "(in core)"

Re: [PATCH v2] grep: provide sane default to grep_source struct

2019-05-21 Thread Emily Shaffer
On Thu, May 16, 2019 at 06:02:54PM -0400, Jeff King wrote: > On Thu, May 16, 2019 at 02:44:44PM -0700, Emily Shaffer wrote: > > > grep_buffer creates a struct grep_source gs and calls grep_source() > > with it. However, gs.name is null, which eventually produces a > > segmentation fault in > > gre

Re: [PATCH v2] grep: provide sane default to grep_source struct

2019-05-16 Thread Jeff King
On Thu, May 16, 2019 at 02:44:44PM -0700, Emily Shaffer wrote: > grep_buffer creates a struct grep_source gs and calls grep_source() > with it. However, gs.name is null, which eventually produces a > segmentation fault in > grep_source()->grep_source_1()->show_line() when grep_opt.status_only is >

[PATCH v2] grep: provide sane default to grep_source struct

2019-05-16 Thread Emily Shaffer
grep_buffer creates a struct grep_source gs and calls grep_source() with it. However, gs.name is null, which eventually produces a segmentation fault in grep_source()->grep_source_1()->show_line() when grep_opt.status_only is not set. This seems to be unreachable from existing commands but is reac