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
2f512ff8
Commit
2f512ff8
authored
Aug 05, 2011
by
Carlos Martín Nieto
Committed by
Vicent Marti
Aug 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use strcpy+strcat as memcpy was overlapping
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
parent
0437d991
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/transport_git.c
+3
-2
No files found.
src/transport_git.c
View file @
2f512ff8
...
...
@@ -346,9 +346,10 @@ static int store_pack(char **out, gitno_buffer *buf, git_repository *repo)
char
path
[
GIT_PATH_MAX
],
suff
[]
=
"/objects/pack/pack-received
\0
"
;
off_t
off
=
0
;
memcpy
(
path
,
repo
->
path_repository
,
GIT_PATH_MAX
-
off
);
strcpy
(
path
,
repo
->
path_repository
);
off
+=
strlen
(
repo
->
path_repository
);
memcpy
(
path
+
off
,
suff
,
GIT_PATH_MAX
-
off
-
STRLEN
(
suff
));
strcat
(
path
,
suff
);
//memcpy(path + off, suff, GIT_PATH_MAX - off - STRLEN(suff) - 1);
error
=
git_filebuf_open
(
&
file
,
path
,
GIT_FILEBUF_TEMPORARY
);
if
(
error
<
GIT_SUCCESS
)
...
...
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