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
ee77378d
Commit
ee77378d
authored
Aug 05, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1763 from nvloff/nameless_submodule_segfault
submodule: check alloc and name presence
parents
9b7d02ff
f1af935b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
src/submodule.c
+4
-1
tests-clar/resources/submodules/gitmodules
+4
-0
No files found.
src/submodule.c
View file @
ee77378d
...
...
@@ -1025,6 +1025,7 @@ static int submodule_get(
if
(
!
git_strmap_valid_index
(
smcfg
,
pos
))
{
sm
=
submodule_alloc
(
repo
,
name
);
GITERR_CHECK_ALLOC
(
sm
);
/* insert value at name - if another thread beats us to it, then use
* their record and release our own.
...
...
@@ -1101,8 +1102,10 @@ static int submodule_load_from_config(
namestart
=
key
+
strlen
(
"submodule."
);
property
=
strrchr
(
namestart
,
'.'
);
if
(
property
==
NULL
)
if
(
!
property
||
(
property
==
namestart
))
return
0
;
property
++
;
is_path
=
(
strcasecmp
(
property
,
"path"
)
==
0
);
...
...
tests-clar/resources/submodules/gitmodules
View file @
ee77378d
[submodule "testrepo"]
path = testrepo
url =
[submodule ""]
path = testrepo
url =
\ No newline at end of file
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