diff options
author | drh <drh@noemail.net> | 2015-12-04 03:27:45 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-12-04 03:27:45 +0000 |
commit | 2f5bfd959a389037eb46e4c6e8e50fc3cd9c05bb (patch) | |
tree | b3c40ecd2dc0685cdad4bceaa67ac27b41d4fecc /src/test_fs.c | |
parent | 15427279c89f766e8ec8519e92c0ddd49d5af22a (diff) | |
download | sqlite-2f5bfd959a389037eb46e4c6e8e50fc3cd9c05bb.tar.gz sqlite-2f5bfd959a389037eb46e4c6e8e50fc3cd9c05bb.zip |
Prevent a segfault on Solaris in the test_fs.c due to differences in the
definition of the dirent object.
FossilOrigin-Name: 042738ad3b769ad70fd7603f928d5b94a952267d
Diffstat (limited to 'src/test_fs.c')
-rw-r--r-- | src/test_fs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test_fs.c b/src/test_fs.c index de332fa2f..ab6bed8a9 100644 --- a/src/test_fs.c +++ b/src/test_fs.c @@ -202,7 +202,10 @@ static int fsdirBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ */ static int fsdirOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ FsdirCsr *pCur; - pCur = (FsdirCsr*)sqlite3_malloc(sizeof(FsdirCsr)); + /* Allocate an extra 256 bytes because it is undefined how big dirent.d_name + ** is and we need enough space. Linux provides plenty already, but + ** Solaris only provides one byte. */ + pCur = (FsdirCsr*)sqlite3_malloc(sizeof(FsdirCsr)+256); if( pCur==0 ) return SQLITE_NOMEM; memset(pCur, 0, sizeof(FsdirCsr)); *ppCursor = &pCur->base; |