We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3e35404 + 0ae04a6 commit 721b245Copy full SHA for 721b245
src/Database.cpp
@@ -310,7 +310,8 @@ Header Database::getHeaderInfo(const std::string& aFilename)
310
}
311
312
// If the "magic string" can't be found then header is invalid, corrupt or unreadable
313
- strncpy(pHeaderStr, pBuf, 16);
+ memcpy(pHeaderStr, pBuf, 16);
314
+ pHeaderStr[15] = '\0';
315
if (strncmp(pHeaderStr, "SQLite format 3", 15) != 0)
316
{
317
throw SQLite::Exception("Invalid or encrypted SQLite header in file " + aFilename);
0 commit comments