1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Fix a problem in xFullPathname for the unix VFS. The problem was found by

Kostya Serebryany using libFuzzer.

FossilOrigin-Name: bb1e2c4df0b81327923f121dd6c002845486a314
This commit is contained in:
drh
2015-11-30 22:22:23 +00:00
parent 40fe8d31f5
commit 025d2f7ad8
4 changed files with 21 additions and 9 deletions

View File

@@ -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);