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

In the command-line shell, defend against a NULL-pointer dereference in the

case where sqlite3_column_name() returns NULL (as might happen following an
OOM error).

FossilOrigin-Name: ac15455abcb9bdb88b53129348668a1442f6899f
This commit is contained in:
drh
2014-01-13 20:38:35 +00:00
parent 859bc542c6
commit c3d6ba49c6
3 changed files with 8 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
C For\sstatements\sof\sjust\san\sunadorned\sVALUES\sclause,\sassign\scolumn\snames\nas\s"columnN"\sfor\sincreasing\swhole\snumbers\sN. C In\sthe\scommand-line\sshell,\sdefend\sagainst\sa\sNULL-pointer\sdereference\sin\sthe\ncase\swhere\ssqlite3_column_name()\sreturns\sNULL\s(as\smight\shappen\sfollowing\san\nOOM\serror).
D 2014-01-13T20:32:18.451 D 2014-01-13T20:38:35.227
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81 F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -220,7 +220,7 @@ F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
F src/resolve.c 7eda9097b29fcf3d2b42fdc17d1de672134e09b6 F src/resolve.c 7eda9097b29fcf3d2b42fdc17d1de672134e09b6
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0 F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
F src/select.c 996d8b88603edbd478aaa70b75d535a3ddea933d F src/select.c 996d8b88603edbd478aaa70b75d535a3ddea933d
F src/shell.c a3541193d5fce37e91dad8ef46a9505aa7c9b344 F src/shell.c 9f3bc02a658b8f61d2cbe60cfc482f660c1c6c48
F src/sqlite.h.in d94a8b89522f526ba711182ee161e06f8669bcc9 F src/sqlite.h.in d94a8b89522f526ba711182ee161e06f8669bcc9
F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e
F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc
@@ -1148,7 +1148,7 @@ F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
P 29ba458d849ad8864711cbe59fb10447a947e06a P 260587d2727f66d7fd65ef672ee46c92024f1d30
R cfc0f0611de592f2675967818ec833a9 R 10a3b37371baf3bb8cfb66250579708d
U drh U drh
Z 9bc6839af49500894d0d88a693460511 Z b723d9f207dc3deb542b9214e1e7a09c

View File

@@ -1 +1 @@
260587d2727f66d7fd65ef672ee46c92024f1d30 ac15455abcb9bdb88b53129348668a1442f6899f

View File

@@ -597,6 +597,7 @@ static void output_c_string(FILE *out, const char *z){
*/ */
static void output_html_string(FILE *out, const char *z){ static void output_html_string(FILE *out, const char *z){
int i; int i;
if( z==0 ) z = "";
while( *z ){ while( *z ){
for(i=0; z[i] for(i=0; z[i]
&& z[i]!='<' && z[i]!='<'