1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Never use strlen(). Use our own internal sqlite3Strlen30() which is

guaranteed to never overflow an integer.  Additional explicit casts to
avoid nuisance warning messages. (CVS 6007)

FossilOrigin-Name: c872d554930ecf221ac2be5f886d5d67bb35288c
This commit is contained in:
drh
2008-12-10 19:26:22 +00:00
parent b27b7f5d3b
commit ea6788322e
35 changed files with 300 additions and 250 deletions

View File

@@ -13,7 +13,7 @@
** This file contains functions used to access the internal hash tables
** of user defined functions and collation sequences.
**
** $Id: callback.c,v 1.32 2008/10/10 17:41:29 drh Exp $
** $Id: callback.c,v 1.33 2008/12/10 19:26:22 drh Exp $
*/
#include "sqliteInt.h"
@@ -56,7 +56,7 @@ static void callCollNeeded(sqlite3 *db, const char *zName, int nName){
static int synthCollSeq(sqlite3 *db, CollSeq *pColl){
CollSeq *pColl2;
char *z = pColl->zName;
int n = strlen(z);
int n = sqlite3Strlen30(z);
int i;
static const u8 aEnc[] = { SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8 };
for(i=0; i<3; i++){
@@ -287,7 +287,7 @@ void sqlite3FuncDefInsert(
FuncDef *pDef /* The function definition to insert */
){
FuncDef *pOther;
int nName = strlen(pDef->zName);
int nName = sqlite3Strlen30(pDef->zName);
u8 c1 = (u8)pDef->zName[0];
int h = (sqlite3UpperToLower[c1] + nName) % ArraySize(pHash->a);
pOther = functionSearch(pHash, h, pDef->zName, nName);