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
622e12c1
Unverified
Commit
622e12c1
authored
Aug 16, 2018
by
Patrick Steinhardt
Committed by
GitHub
Aug 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4749 from neithernut/fix-git__linenlen-ub
parse: Do not initialize the content in context to NULL
parents
43e7bf78
d1bfe614
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/parse.c
+7
-4
No files found.
src/parse.c
View file @
622e12c1
...
...
@@ -8,12 +8,14 @@
int
git_parse_ctx_init
(
git_parse_ctx
*
ctx
,
const
char
*
content
,
size_t
content_len
)
{
if
(
content
_len
)
if
(
content
&&
content_len
)
{
ctx
->
content
=
content
;
else
ctx
->
content
=
NULL
;
ctx
->
content_len
=
content_len
;
}
else
{
ctx
->
content
=
""
;
ctx
->
content_len
=
0
;
}
ctx
->
content_len
=
content_len
;
ctx
->
remain
=
ctx
->
content
;
ctx
->
remain_len
=
ctx
->
content_len
;
ctx
->
line
=
ctx
->
remain
;
...
...
@@ -26,6 +28,7 @@ int git_parse_ctx_init(git_parse_ctx *ctx, const char *content, size_t content_l
void
git_parse_ctx_clear
(
git_parse_ctx
*
ctx
)
{
memset
(
ctx
,
0
,
sizeof
(
*
ctx
));
ctx
->
content
=
""
;
}
void
git_parse_advance_line
(
git_parse_ctx
*
ctx
)
...
...
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