1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

Make sure enough memory is allocated for pathological quoting cases when

computing a quoted table name in the command-line shell.

FossilOrigin-Name: 0583b84ab444db3ae3c93db619b67bf84b0305ab989200e77214e02ff2dc923a
This commit is contained in:
drh
2017-06-24 13:31:40 +00:00
parent 65c2a71042
commit 45e7d7dd1c
3 changed files with 9 additions and 9 deletions

View File

@@ -2363,7 +2363,7 @@ static void set_table_name(ShellState *p, const char *zName){
if( zName==0 ) return;
cQuote = quoteChar(zName);
n = strlen30(zName);
if( cQuote ) n += 2;
if( cQuote ) n += n+2;
z = p->zDestTable = malloc( n+1 );
if( z==0 ){
raw_printf(stderr,"Error: out of memory\n");