mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +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:
@@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that are called by the parser
|
||||
** to handle INSERT statements in SQLite.
|
||||
**
|
||||
** $Id: insert.c,v 1.254 2008/12/10 17:20:00 drh Exp $
|
||||
** $Id: insert.c,v 1.255 2008/12/10 19:26:24 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -1272,10 +1272,10 @@ void sqlite3GenerateConstraintChecks(
|
||||
char zErrMsg[200];
|
||||
sqlite3_snprintf(ArraySize(zErrMsg), zErrMsg,
|
||||
pIdx->nColumn>1 ? "columns " : "column ");
|
||||
n1 = strlen(zErrMsg);
|
||||
n1 = sqlite3Strlen30(zErrMsg);
|
||||
for(j=0; j<pIdx->nColumn && n1<ArraySize(zErrMsg)-30; j++){
|
||||
char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName;
|
||||
n2 = strlen(zCol);
|
||||
n2 = sqlite3Strlen30(zCol);
|
||||
if( j>0 ){
|
||||
sqlite3_snprintf(ArraySize(zErrMsg)-n1, &zErrMsg[n1], ", ");
|
||||
n1 += 2;
|
||||
|
||||
Reference in New Issue
Block a user