1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-24 09:53:10 +03:00

Fix a problem in check-in (6226) which could cause an assertion fault

following a malloc failure.  The prior check-in was for ticket #3624. (CVS 6235)

FossilOrigin-Name: 1ffe44e9d6b49346a75850a977953de12c127069
This commit is contained in:
drh
2009-02-03 13:19:12 +00:00
parent 478000cf5c
commit 2333606e9c
3 changed files with 10 additions and 9 deletions

View File

@@ -16,7 +16,7 @@
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: func.c,v 1.219 2009/02/03 13:10:54 drh Exp $
** $Id: func.c,v 1.220 2009/02/03 13:19:12 drh Exp $
*/
#include "sqliteInt.h"
#include <stdlib.h>
@@ -843,7 +843,8 @@ static void replaceFunc(
assert( zStr==sqlite3_value_text(argv[0]) ); /* No encoding change */
zPattern = sqlite3_value_text(argv[1]);
if( zPattern==0 ){
assert( sqlite3_value_type(argv[1])==SQLITE_NULL );
assert( sqlite3_value_type(argv[1])==SQLITE_NULL
|| sqlite3_context_db_handle(context)->mallocFailed );
return;
}
if( zPattern[0]==0 ){