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
f1af935b
Commit
f1af935b
authored
Aug 05, 2013
by
Nikolai Vladimirov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
submodule: check alloc and name presense
parent
9b7d02ff
Hide 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 @
f1af935b
...
@@ -1025,6 +1025,7 @@ static int submodule_get(
...
@@ -1025,6 +1025,7 @@ static int submodule_get(
if
(
!
git_strmap_valid_index
(
smcfg
,
pos
))
{
if
(
!
git_strmap_valid_index
(
smcfg
,
pos
))
{
sm
=
submodule_alloc
(
repo
,
name
);
sm
=
submodule_alloc
(
repo
,
name
);
GITERR_CHECK_ALLOC
(
sm
);
/* insert value at name - if another thread beats us to it, then use
/* insert value at name - if another thread beats us to it, then use
* their record and release our own.
* their record and release our own.
...
@@ -1101,8 +1102,10 @@ static int submodule_load_from_config(
...
@@ -1101,8 +1102,10 @@ static int submodule_load_from_config(
namestart
=
key
+
strlen
(
"submodule."
);
namestart
=
key
+
strlen
(
"submodule."
);
property
=
strrchr
(
namestart
,
'.'
);
property
=
strrchr
(
namestart
,
'.'
);
if
(
property
==
NULL
)
if
(
!
property
||
(
property
==
namestart
))
return
0
;
return
0
;
property
++
;
property
++
;
is_path
=
(
strcasecmp
(
property
,
"path"
)
==
0
);
is_path
=
(
strcasecmp
(
property
,
"path"
)
==
0
);
...
...
tests-clar/resources/submodules/gitmodules
View file @
f1af935b
[submodule "testrepo"]
[submodule "testrepo"]
path = testrepo
path = testrepo
url =
[submodule ""]
path = testrepo
url =
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