diff options
Diffstat (limited to 'src')
-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; |