Fossil SCM

Cherrypick SQLite [http://www.sqlite.org/src/info/ac15455abc|ac15455abc]: 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)

jan.nijtmans 2014-01-14 08:29 UTC branch-1.28
Commit a12b9c453396dce8028aa371660da5ed62505f8d
1 file changed +1
--- src/shell.c
+++ src/shell.c
@@ -595,10 +595,11 @@
595595
** Output the given string with characters that are special to
596596
** HTML escaped.
597597
*/
598598
static void output_html_string(FILE *out, const char *z){
599599
int i;
600
+ if( z==0 ) z = "";
600601
while( *z ){
601602
for(i=0; z[i]
602603
&& z[i]!='<'
603604
&& z[i]!='&'
604605
&& z[i]!='>'
605606
--- src/shell.c
+++ src/shell.c
@@ -595,10 +595,11 @@
595 ** Output the given string with characters that are special to
596 ** HTML escaped.
597 */
598 static void output_html_string(FILE *out, const char *z){
599 int i;
 
600 while( *z ){
601 for(i=0; z[i]
602 && z[i]!='<'
603 && z[i]!='&'
604 && z[i]!='>'
605
--- src/shell.c
+++ src/shell.c
@@ -595,10 +595,11 @@
595 ** Output the given string with characters that are special to
596 ** HTML escaped.
597 */
598 static void output_html_string(FILE *out, const char *z){
599 int i;
600 if( z==0 ) z = "";
601 while( *z ){
602 for(i=0; z[i]
603 && z[i]!='<'
604 && z[i]!='&'
605 && z[i]!='>'
606

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button