mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-19 17:03:58 +00:00
crlf: do not ignore GIT_PASSTHROUGH error
When no payload is set for `crlf_apply` we try to compute the crlf attributes ourselves with `crlf_check`. When the function determines that the current file does not require any treatment we return the GIT_PASSTHROUGH error code without actually allocating the out-pointer, which indicates the file should not be passed through the filter. The `crlf_apply` function explicitly checks for the GIT_PASSTHROUGH return code and ignores it. This means we will try to apply the crlf-filter to the current file, leading us to dereference the unallocated payload-pointer. Fix this obviously incorrect behavior by not treating GIT_PASSTHROUGH in any special way. This is the correct thing to do anyway, as the code indicates that the file should not be passed through the filter.
This commit is contained in:
parent
b9f28b8d52
commit
2129d6df93
@ -346,7 +346,7 @@ static int crlf_apply(
|
||||
/* initialize payload in case `check` was bypassed */
|
||||
if (!*payload) {
|
||||
int error = crlf_check(self, payload, src, NULL);
|
||||
if (error < 0 && error != GIT_PASSTHROUGH)
|
||||
if (error < 0)
|
||||
return error;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user