]> git.proxmox.com Git - libgit2.git/commit
diff_tform: fix potential NULL pointer access
authorPatrick Steinhardt <ps@pks.im>
Tue, 23 Feb 2016 10:07:03 +0000 (11:07 +0100)
committerPatrick Steinhardt <ps@pks.im>
Tue, 23 Feb 2016 11:07:37 +0000 (12:07 +0100)
commit32f0798413f83cbd1c22e11d81eeb9f664181ec9
tree175a37ecc6c982dbd59f08102e63593e44b4f2cd
parent3d1abc5afcee2b878d835df11530aab8ffa0d1e1
diff_tform: fix potential NULL pointer access

The `normalize_find_opts` function in theory allows for the
incoming diff to have no repository. When the caller does not
pass in diff find options or if the GIT_DIFF_FIND_BY_CONFIG value
is set, though, we try to derive the configuration from the
diff's repository configuration without first verifying that the
repository is actually set to a non-NULL value.

Fix this issue by explicitly checking if the repository is set
and if it is not, fall back to a default value of
GIT_DIFF_FIND_RENAMES.
src/diff_tform.c