Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
1b0ef5aa
Commit
1b0ef5aa
authored
Jun 19, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #774 from benstraub/revparse-colon-segfault
Fix potential segfault in revparse.
parents
68f527c4
2c90145a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
+7
-1
src/revparse.c
+6
-1
tests-clar/refs/revparse.c
+1
-0
No files found.
src/revparse.c
View file @
1b0ef5aa
...
...
@@ -406,7 +406,7 @@ static int handle_caret_syntax(git_object **out, git_repository *repo, git_objec
*
out
=
newobj2
;
return
0
;
}
/* {/...} -> Walk all commits until we see a commit msg that matches the phrase. */
if
(
movement
[
1
]
==
'/'
)
{
int
retcode
=
GIT_ERROR
;
...
...
@@ -550,6 +550,11 @@ static int oid_for_tree_path(git_oid *out, git_tree *tree, git_repository *repo,
}
}
if
(
!
entry
)
{
giterr_set
(
GITERR_INVALID
,
"Invalid tree path '%s'"
,
path
);
return
GIT_ERROR
;
}
git_oid_cpy
(
out
,
git_tree_entry_id
(
entry
));
git__free
(
alloc
);
return
0
;
...
...
tests-clar/refs/revparse.c
View file @
1b0ef5aa
...
...
@@ -163,6 +163,7 @@ void test_refs_revparse__colon(void)
cl_git_fail
(
git_revparse_single
(
&
g_obj
,
g_repo
,
":/"
));
cl_git_fail
(
git_revparse_single
(
&
g_obj
,
g_repo
,
":/not found in any commit"
));
cl_git_fail
(
git_revparse_single
(
&
g_obj
,
g_repo
,
":2:README"
));
cl_git_fail
(
git_revparse_single
(
&
g_obj
,
g_repo
,
"master:"
));
test_object
(
"subtrees:ab/4.txt"
,
"d6c93164c249c8000205dd4ec5cbca1b516d487f"
);
test_object
(
"subtrees:ab/de/fgh/1.txt"
,
"1f67fc4386b2d171e0d21be1c447e12660561f9b"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment