mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Do not crash in the internal functions sqlite_rename_table() or sqlite_rename_trigger() if they are somehow passed unexpected input. (CVS 3944)
FossilOrigin-Name: c2f90b465e37ea49c9e44415f6461e4f636bb64f
This commit is contained in:
13
src/alter.c
13
src/alter.c
@@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that used to generate VDBE code
|
||||
** that implements the ALTER TABLE command.
|
||||
**
|
||||
** $Id: alter.c,v 1.22 2006/09/08 12:27:37 drh Exp $
|
||||
** $Id: alter.c,v 1.23 2007/05/08 12:37:46 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -57,6 +57,11 @@ static void renameTableFunc(
|
||||
*/
|
||||
if( zSql ){
|
||||
do {
|
||||
if( !*zCsr ){
|
||||
/* Ran out of input before finding an opening bracket. Return NULL. */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Store the token that zCsr points to in tname. */
|
||||
tname.z = zCsr;
|
||||
tname.n = len;
|
||||
@@ -107,6 +112,12 @@ static void renameTriggerFunc(
|
||||
*/
|
||||
if( zSql ){
|
||||
do {
|
||||
|
||||
if( !*zCsr ){
|
||||
/* Ran out of input before finding the table name. Return NULL. */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Store the token that zCsr points to in tname. */
|
||||
tname.z = zCsr;
|
||||
tname.n = len;
|
||||
|
||||
Reference in New Issue
Block a user