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
+3 -3
View File
@@ -12,7 +12,7 @@
** This file contains routines used to translate between UTF-8,
** UTF-16, UTF-16BE, and UTF-16LE.
**
** $Id: utf.c,v 1.68 2008/12/09 03:55:14 drh Exp $
** $Id: utf.c,v 1.69 2008/12/10 19:26:24 drh Exp $
**
** Notes on UTF-8:
**
@@ -288,7 +288,7 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
WRITE_UTF16BE(z, c);
}
}
pMem->n = z - zOut;
pMem->n = (int)(z - zOut);
*z++ = 0;
}else{
assert( desiredEnc==SQLITE_UTF8 );
@@ -407,7 +407,7 @@ int sqlite3Utf8CharLen(const char *zIn, int nByte){
int sqlite3Utf8To8(unsigned char *zIn){
unsigned char *zOut = zIn;
unsigned char *zStart = zIn;
unsigned char *zTerm = &zIn[strlen((char *)zIn)];
unsigned char *zTerm = &zIn[sqlite3Strlen30((char *)zIn)];
u32 c;
while( zIn[0] ){