aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-11-30 22:22:23 +0000
committerdrh <drh@noemail.net>2015-11-30 22:22:23 +0000
commit025d2f7ad8d29f25c111b3abb668528b7389570a (patch)
treecf11b24bf56c508177d964a878f602f5e1b32347 /src
parent40fe8d31f54a823da92a85f9aa43fde92091fca5 (diff)
downloadsqlite-025d2f7ad8d29f25c111b3abb668528b7389570a.tar.gz
sqlite-025d2f7ad8d29f25c111b3abb668528b7389570a.zip
Fix a problem in xFullPathname for the unix VFS. The problem was found by
Kostya Serebryany using libFuzzer. FossilOrigin-Name: bb1e2c4df0b81327923f121dd6c002845486a314
Diffstat (limited to 'src')
-rw-r--r--src/os_unix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 49f6563b1..e5103856b 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5981,7 +5981,9 @@ static int unixFullPathname(
** truncated to make it fit. This is Ok, as SQLite refuses to open any
** file for which this function returns a full path larger than (nOut-8)
** bytes in size. */
- if( zOut[0]!='/' ){
+ testcase( nByte==nOut-5 );
+ testcase( nByte==nOut-4 );
+ if( zOut[0]!='/' && nByte<nOut-4 ){
int nCwd;
int nRem = nOut-nByte-1;
memmove(&zOut[nRem], zOut, nByte+1);