aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pager.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pager.c b/src/pager.c
index 7f8d053a9..ae75aeb7c 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -4911,11 +4911,13 @@ int sqlite3PagerOpen(
/* Fill in the Pager.zFilename and pPager.zQueryParam fields */
pPtr[0] = '\003'; pPtr[1] = 0; pPtr += 2;
pPager->zFilename = (char*)pPtr;
- memcpy(pPtr, zPathname, nPathname); pPtr += nPathname + 1;
- if( zUri ){
- memcpy(pPtr, zUri, nUriByte); /* pPtr += nUriByte; // not needed */
+ if( nPathname>0 ){
+ memcpy(pPtr, zPathname, nPathname); pPtr += nPathname + 1;
+ if( zUri ){
+ memcpy(pPtr, zUri, nUriByte); /* pPtr += nUriByte; // not needed */
+ }
+ /* Double-zero terminator implied by the sqlite3MallocZero */
}
- /* Double-zero terminator implied by the sqlite3MallocZero */
if( nPathname ) sqlite3DbFree(0, zPathname);
pPager->pVfs = pVfs;