* segfault bug in internal git grep from next
@ 2006-05-03 8:32 Marco Roeland
2006-05-04 8:44 ` segfault bug in internal git grep from next (fixed) Marco Roeland
0 siblings, 1 reply; 2+ messages in thread
From: Marco Roeland @ 2006-05-03 8:32 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]
Hello!
I'm using the next branch as of commit 6a40327d242dac9f85c6d63c94d537b45ba86e89
A segfault occurs in using the new builtin grep when using it on a
binary file, so no regular \n endings.
A testcase is the attached (if it survives the vger filters) "git.png"
icon as it is used for example on the http://www.kernel.org/git website.
I tried the obvious, this is the line that gives the segfault:
diff --git a/builtin-grep.c b/builtin-grep.c
index 09e3677..5d4f319 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -121,7 +121,7 @@ static void compile_patterns(struct grep
static char *end_of_line(char *cp, unsigned long *left)
{
unsigned long l = *left;
- while (l && *cp != '\n') {
+ while (l && *cp && *cp != '\n') {
l--;
cp++;
}
but it did not solve the problem. Unfortunately I have no time at the
moment to investigate further, so just this report at the moment.
On a side-note it might be handy to add the icon to the main git
repository and to use it in (new) test cases for git grep. Of course
grepping in binary files is mostly not very useful, but lots of
real-world repo's have some binaries.
--
Marco Roeland
[-- Attachment #2: git.png --]
[-- Type: image/png, Size: 208 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: segfault bug in internal git grep from next (fixed)
2006-05-03 8:32 segfault bug in internal git grep from next Marco Roeland
@ 2006-05-04 8:44 ` Marco Roeland
0 siblings, 0 replies; 2+ messages in thread
From: Marco Roeland @ 2006-05-04 8:44 UTC (permalink / raw)
To: git
On Wednesday May 3rd 2006 Marco Roeland wrote:
> I'm using the next branch as of commit 6a40327d242dac9f85c6d63c94d537b45ba86e89
>
> A segfault occurs in using the new builtin grep when using it on a
> binary file, so no regular \n endings.
Fixed by Junio in commit 7ed36f56e33bd838d06521a37a916516397e9e8b.
I really use git grep a lot. It is very powerful, and the builtin version
makes even more possible. Thanks very much,
--
Marco Roeland
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-05-04 8:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-03 8:32 segfault bug in internal git grep from next Marco Roeland
2006-05-04 8:44 ` segfault bug in internal git grep from next (fixed) Marco Roeland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).