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

Make sure the shared-memory filename sythesized by os_win.c is

double-zero terminated, so that it can be used with
sqlite3_uri_parameter().

FossilOrigin-Name: 429380f99c59ca10de18638ce6f9ec7c47082999
This commit is contained in:
drh
2012-01-08 12:32:09 +00:00
parent 0547e2ff7b
commit d522620a7d
3 changed files with 10 additions and 10 deletions

View File

@@ -2463,12 +2463,12 @@ static int winOpenSharedMemory(winFile *pDbFd){
if( p==0 ) return SQLITE_IOERR_NOMEM;
memset(p, 0, sizeof(*p));
nName = sqlite3Strlen30(pDbFd->zPath);
pNew = sqlite3_malloc( sizeof(*pShmNode) + nName + 16 );
pNew = sqlite3_malloc( sizeof(*pShmNode) + nName + 17 );
if( pNew==0 ){
sqlite3_free(p);
return SQLITE_IOERR_NOMEM;
}
memset(pNew, 0, sizeof(*pNew));
memset(pNew, 0, sizeof(*pNew) + nName + 17);
pNew->zFilename = (char*)&pNew[1];
sqlite3_snprintf(nName+15, pNew->zFilename, "%s-shm", pDbFd->zPath);
sqlite3FileSuffix3(pDbFd->zPath, pNew->zFilename);