diff options
| author | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-08-05 18:11:30 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-08-18 02:34:08 +0200 |
| commit | 2f512ff81e1705c0246416f2292b53540f88fd19 (patch) | |
| tree | a8af2b6f5abd047d02cf9504e0eb395386d3a4ec /src | |
| parent | 0437d991bfb67ffd2d3bb3d5a2cf21261ea42029 (diff) | |
| download | libgit2-2f512ff81e1705c0246416f2292b53540f88fd19.tar.gz | |
Use strcpy+strcat as memcpy was overlapping
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Diffstat (limited to 'src')
| -rw-r--r-- | src/transport_git.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/transport_git.c b/src/transport_git.c index 4a10f17cd..5f03a4b20 100644 --- a/src/transport_git.c +++ b/src/transport_git.c @@ -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) |
