diff options
author | Christoph Thelen <doc_bacardi@users.sourceforge.net> | 2020-08-27 21:47:48 +0200 |
---|---|---|
committer | Christoph Thelen <doc_bacardi@users.sourceforge.net> | 2020-08-27 21:47:48 +0200 |
commit | d10c846e4e91fc299de194b3d4dd76fc4451cf67 (patch) | |
tree | 85e1825ff2cc69ac8f486cc858274ea902a32274 | |
parent | da3288ded5bce2a37566126be51fe75ff0316c2d (diff) | |
download | libgit2-d10c846e4e91fc299de194b3d4dd76fc4451cf67.tar.gz |
Fix crash in git_describe_commit when opts are NULL.
The argument "opts" can be NULL, which selects default options. Do not access
"opts" directly but only the normalized copy.
-rw-r--r-- | src/describe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/describe.c b/src/describe.c index c8a175214..8beffdeba 100644 --- a/src/describe.c +++ b/src/describe.c @@ -685,7 +685,7 @@ int git_describe_commit( get_name, &data)) < 0) goto cleanup; - if (git_oidmap_size(data.names) == 0 && !opts->show_commit_oid_as_fallback) { + if (git_oidmap_size(data.names) == 0 && !normalized.show_commit_oid_as_fallback) { git_error_set(GIT_ERROR_DESCRIBE, "cannot describe - " "no reference found, cannot describe anything."); error = -1; |