diff options
author | Ken Takata <kentkt@csc.jp> | 2023-10-16 09:57:43 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-10-16 09:57:43 +0200 |
commit | 215c3261a25f7a99e8711a3b3c6158119c6aea9e (patch) | |
tree | 6ba5f52dbbab4b9e6cdee451a143cd637ae1e02c | |
parent | dbf749bd5aaef6ea2d28bce081349785d174d96a (diff) |
patch 9.0.2033: gcc overflow-warning for f_resolvev9.0.2033
Problem: gcc overflow-warning for f_resolve
Solution: use pointer p instead of pointer q[-1]
Suppress the following warning:
```
filepath.c: In function ‘f_resolve’:
filepath.c:2162:27: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
2162 | q[-1] = NUL;
```
Closes: #13352
closes: #13353
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
-rw-r--r-- | src/filepath.c | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/filepath.c b/src/filepath.c index c30d9bf82b..1ea0623867 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -2159,7 +2159,7 @@ f_resolve(typval_T *argvars, typval_T *rettv) if (q > p && *q == NUL) { // Ignore trailing path separator. - q[-1] = NUL; + p[q - p - 1] = NUL; q = gettail(p); } if (q > p && !mch_isFullName(buf)) diff --git a/src/version.c b/src/version.c index 2e14a90bba..761cdd5e27 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2033, +/**/ 2032, /**/ 2031, |