diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2020-04-05 11:07:54 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2020-11-25 11:42:03 +0000 |
| commit | cb4bfbc99dffa7679f42cf8500931fa250bb7db3 (patch) | |
| tree | b3321a749eeba776074824d04f49fb47ddf978c1 /src/describe.c | |
| parent | a6dd58659d16207ec92a1f4d87ec620236ce4a23 (diff) | |
| download | libgit2-cb4bfbc99dffa7679f42cf8500931fa250bb7db3.tar.gz | |
buffer: git_buf_sanitize should return a value
`git_buf_sanitize` is called with user-input, and wants to sanity-check
that input. Allow it to return a value if the input was malformed in a
way that we cannot cope.
Diffstat (limited to 'src/describe.c')
| -rw-r--r-- | src/describe.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/describe.c b/src/describe.c index 8beffdeba..ebf70b062 100644 --- a/src/describe.c +++ b/src/describe.c @@ -780,7 +780,8 @@ int git_describe_format(git_buf *out, const git_describe_result *result, const g GIT_ERROR_CHECK_VERSION(given, GIT_DESCRIBE_FORMAT_OPTIONS_VERSION, "git_describe_format_options"); normalize_format_options(&opts, given); - git_buf_sanitize(out); + if ((error = git_buf_sanitize(out)) < 0) + return error; if (opts.always_use_long_format && opts.abbreviated_size == 0) { |
