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

Fix three crash problems discovered by afl-fuzz.

Ticket [a59ae93ee990a55].

FossilOrigin-Name: fe5788633131281a0f27c5b75993ce2ff958bfeb
This commit is contained in:
drh
2015-01-09 01:27:29 +00:00
parent fa5ed0283c
commit 655814d2bd
5 changed files with 38 additions and 15 deletions

View File

@@ -895,8 +895,10 @@ static void strftimeFunc(
size_t i,j;
char *z;
sqlite3 *db;
const char *zFmt = (const char*)sqlite3_value_text(argv[0]);
const char *zFmt;
char zBuf[100];
if( argc==0 ) return;
zFmt = (const char*)sqlite3_value_text(argv[0]);
if( zFmt==0 || isDate(context, argc-1, argv+1, &x) ) return;
db = sqlite3_context_db_handle(context);
for(i=0, n=1; zFmt[i]; i++, n++){