1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-04 20:02:48 +03:00

Fix limit assertions in vdbe.c. Ticket #2740. (CVS 4506)

FossilOrigin-Name: 27f846d089ebe9e4970a2499ad4e2e98773d2e78
This commit is contained in:
drh
2007-10-23 14:55:06 +00:00
parent 9bc5449f9d
commit 55bfeb10cb
3 changed files with 15 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
C Make\ssure\sthe\ssqlite3_vfs_register()\sand\ssqlite3_vfs_unregister()\sAPIs\nwork\sright\seven\sif\snot\sVFS\sis\scurrently\sregistered.\s\sTicket\s#2738.\s(CVS\s4505) C Fix\slimit\sassertions\sin\svdbe.c.\s\sTicket\s#2740.\s(CVS\s4506)
D 2007-10-23T14:49:59 D 2007-10-23T14:55:07
F Makefile.in 30c7e3ba426ddb253b8ef037d1873425da6009a8 F Makefile.in 30c7e3ba426ddb253b8ef037d1873425da6009a8
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -165,7 +165,7 @@ F src/update.c e89b980b443d44b68bfc0b1746cdb6308e049ac9
F src/utf.c ef4b7d83bae533b76c3e1bf635b113fdad86a736 F src/utf.c ef4b7d83bae533b76c3e1bf635b113fdad86a736
F src/util.c 49263637e0f228411201501ddfd1138338d6322c F src/util.c 49263637e0f228411201501ddfd1138338d6322c
F src/vacuum.c a5e51c77370c1a6445e86d42abfc43867cdd482d F src/vacuum.c a5e51c77370c1a6445e86d42abfc43867cdd482d
F src/vdbe.c 57e37b55c4dcdc9ed71c57180cee514c33d0e8f9 F src/vdbe.c b21ea40c5b0ae4379394fa2aad92909e1a8736b5
F src/vdbe.h 03a0fa17f6753a24d6cb585d7a362944a2c115aa F src/vdbe.h 03a0fa17f6753a24d6cb585d7a362944a2c115aa
F src/vdbeInt.h 630145b9bfaa19190ab491f52658a7db550f2247 F src/vdbeInt.h 630145b9bfaa19190ab491f52658a7db550f2247
F src/vdbeapi.c 21b69e71ab39d8e694c9cdb556a74dbefba9ebda F src/vdbeapi.c 21b69e71ab39d8e694c9cdb556a74dbefba9ebda
@@ -584,7 +584,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 3e3475b9e0f996841aa40419693c7c3eaa6c71aa P c36500871e85b55cb0804d5c9e88fa6861a507a9
R f5b08c77641b2a161a8d65b96bb2a7d8 R 407160c3c038e7e8a4d0ba1b11794db6
U drh U drh
Z 7b5ff5d5e516010e45b59cf86b7b1e00 Z 0e481a3e67cd54e4694f0f724a957ac6

View File

@@ -1 +1 @@
c36500871e85b55cb0804d5c9e88fa6861a507a9 27f846d089ebe9e4970a2499ad4e2e98773d2e78

View File

@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing ** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code. ** commenting and indentation practices when changing or adding code.
** **
** $Id: vdbe.c,v 1.651 2007/10/05 16:23:55 drh Exp $ ** $Id: vdbe.c,v 1.652 2007/10/23 14:55:07 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <ctype.h> #include <ctype.h>
@@ -745,8 +745,8 @@ case OP_String8: { /* same as TK_STRING */
assert( pOp->p3!=0 ); assert( pOp->p3!=0 );
pOp->opcode = OP_String; pOp->opcode = OP_String;
pOp->p1 = strlen(pOp->p3); pOp->p1 = strlen(pOp->p3);
assert( SQLITE_MAX_SQL_LENGTH < SQLITE_MAX_LENGTH ); assert( SQLITE_MAX_SQL_LENGTH <= SQLITE_MAX_LENGTH );
assert( pOp->p1 < SQLITE_MAX_LENGTH ); assert( pOp->p1 <= SQLITE_MAX_LENGTH );
#ifndef SQLITE_OMIT_UTF16 #ifndef SQLITE_OMIT_UTF16
if( encoding!=SQLITE_UTF8 ){ if( encoding!=SQLITE_UTF8 ){
@@ -762,7 +762,7 @@ case OP_String8: { /* same as TK_STRING */
pOp->p3type = P3_DYNAMIC; pOp->p3type = P3_DYNAMIC;
pOp->p3 = pTos->z; pOp->p3 = pTos->z;
pOp->p1 = pTos->n; pOp->p1 = pTos->n;
assert( pOp->p1 < SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */ assert( pOp->p1 <= SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */
break; break;
} }
#endif #endif
@@ -774,7 +774,7 @@ case OP_String8: { /* same as TK_STRING */
** The string value P3 of length P1 (bytes) is pushed onto the stack. ** The string value P3 of length P1 (bytes) is pushed onto the stack.
*/ */
case OP_String: { case OP_String: {
assert( pOp->p1 < SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */ assert( pOp->p1 <= SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */
pTos++; pTos++;
assert( pOp->p3!=0 ); assert( pOp->p3!=0 );
pTos->flags = MEM_Str|MEM_Static|MEM_Term; pTos->flags = MEM_Str|MEM_Static|MEM_Term;
@@ -808,8 +808,8 @@ case OP_Null: {
case OP_HexBlob: { /* same as TK_BLOB */ case OP_HexBlob: { /* same as TK_BLOB */
pOp->opcode = OP_Blob; pOp->opcode = OP_Blob;
pOp->p1 = strlen(pOp->p3)/2; pOp->p1 = strlen(pOp->p3)/2;
assert( SQLITE_MAX_SQL_LENGTH < SQLITE_MAX_LENGTH ); assert( SQLITE_MAX_SQL_LENGTH <= SQLITE_MAX_LENGTH );
assert( pOp->p1 < SQLITE_MAX_LENGTH ); assert( pOp->p1 <= SQLITE_MAX_LENGTH );
if( pOp->p1 ){ if( pOp->p1 ){
char *zBlob = sqlite3HexToBlob(db, pOp->p3); char *zBlob = sqlite3HexToBlob(db, pOp->p3);
if( !zBlob ) goto no_mem; if( !zBlob ) goto no_mem;
@@ -840,7 +840,7 @@ case OP_HexBlob: { /* same as TK_BLOB */
*/ */
case OP_Blob: { case OP_Blob: {
pTos++; pTos++;
assert( pOp->p1 < SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */ assert( pOp->p1 <= SQLITE_MAX_LENGTH ); /* Due to SQLITE_MAX_SQL_LENGTH */
sqlite3VdbeMemSetStr(pTos, pOp->p3, pOp->p1, 0, 0); sqlite3VdbeMemSetStr(pTos, pOp->p3, pOp->p1, 0, 0);
pTos->enc = encoding; pTos->enc = encoding;
break; break;