1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Avoid passing NULL pointers to memcmp() or memcpy(), even when the

"number-of-bytes" argument is passed 0.

FossilOrigin-Name: 56ff72ab44288296efc99a608f7edc4346366a50
This commit is contained in:
dan
2016-12-30 14:15:56 +00:00
parent d0d7e13511
commit 895decf6b5
7 changed files with 46 additions and 42 deletions

View File

@@ -2739,7 +2739,9 @@ int sqlite3ParseUri(
}else{
zFile = sqlite3_malloc64(nUri+2);
if( !zFile ) return SQLITE_NOMEM_BKPT;
memcpy(zFile, zUri, nUri);
if( nUri ){
memcpy(zFile, zUri, nUri);
}
zFile[nUri] = '\0';
zFile[nUri+1] = '\0';
flags &= ~SQLITE_OPEN_URI;