mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 17:12:51 +00:00
Use memmove() in git__dirname and git__basename
We cannot make sure that the user doesn't use the same buffer as source and destination, so write to it using memmove. Signed-off-by: Vicent Marti <tanoku@gmail.com>
This commit is contained in:
parent
60cb1d10b3
commit
246eba80af
@ -82,7 +82,7 @@ Exit:
|
||||
}
|
||||
|
||||
if (len >= 0) {
|
||||
memcpy(buffer, startp, len);
|
||||
memmove(buffer, startp, len);
|
||||
buffer[len] = 0;
|
||||
}
|
||||
return result;
|
||||
@ -140,7 +140,7 @@ Exit:
|
||||
}
|
||||
|
||||
if (len >= 0) {
|
||||
memcpy(buffer, path, len);
|
||||
memmove(buffer, path, len);
|
||||
buffer[len] = 0;
|
||||
}
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user