diff options
| author | lhchavez <lhchavez@lhchavez.com> | 2020-12-21 06:48:48 -0800 |
|---|---|---|
| committer | lhchavez <lhchavez@lhchavez.com> | 2020-12-21 07:02:54 -0800 |
| commit | 212ae9a70eddf3a77783d5cdffd3418273bfedd7 (patch) | |
| tree | 49deb8f4d96eb4b9a81b4f2afb36f5e98abbdf50 /include | |
| parent | f4b473fa842a84147d8036a27bac5c026c44dad4 (diff) | |
| download | libgit2-212ae9a70eddf3a77783d5cdffd3418273bfedd7.tar.gz | |
Fix the `-DENABLE_WERROR=ON` build for gcc 10.2
This change makes it possible to build with newer versions of gcc
without warnings. There were two warnings issued:
* gcc 8 added
[`-Wstringop-truncation`](https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/),
which warns if a call to `strncpy(3)` is prone to accidentally
truncating the destination string, since `strncpy(3)` does NOT add a
terminating `NULL` if the destination buffer is not large enough to
hold the input.
This change uses the pattern suggested in
https://us-cert.cisa.gov/bsi/articles/knowledge/coding-practices/strncpy-and-strncat
to fix the locations flagged by gcc.
* There was a potentially uninitialized access of `dest` in `fs_copy`.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
