filepath.c:2162:27: warning: writing 1 byte into a region of size 0 #13352
Replies: 2 comments 1 reply
-
|
I think this is a false positive, because there is a check --- a/src/filepath.c
+++ b/src/filepath.c
@@ -2159,7 +2159,7 @@ f_resolve(typval_T *argvars, typval_T *r
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)) |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Fixed by 215c326. Closing. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was able to successfully compile from Vim src but received this sole warning:
gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -o objects/filepath.o filepath.c 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;Used cygwin, and here's my config:
./configure --with-features=huge --enable-python3interp --with-python3-config-dir=/usr/bin/python3.9 --with-python3-config-dir=/usr/include/python3.9 --enable-cscope --enable-fail-if-missing --enable-luainterp=yes --enable-terminal --prefix="/cygdrive/e/compile/"In case it's somehow related.The code in question at src/filepath.c seems to ignore a trailing path separator by setting the character before it to null. My understanding of C isn't great so I could be wrong about it. This warning could be trivial because I was able to make install it successfully. Ultimately was just curious what the implications of this are and what this error is related to?
Beta Was this translation helpful? Give feedback.
All reactions