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)
Commit
a12b9c453396dce8028aa371660da5ed62505f8d
Parent
7905fb22f0e6636…
1 file changed
+1
+1
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -595,10 +595,11 @@ | ||
| 595 | 595 | ** Output the given string with characters that are special to |
| 596 | 596 | ** HTML escaped. |
| 597 | 597 | */ |
| 598 | 598 | static void output_html_string(FILE *out, const char *z){ |
| 599 | 599 | int i; |
| 600 | + if( z==0 ) z = ""; | |
| 600 | 601 | while( *z ){ |
| 601 | 602 | for(i=0; z[i] |
| 602 | 603 | && z[i]!='<' |
| 603 | 604 | && z[i]!='&' |
| 604 | 605 | && z[i]!='>' |
| 605 | 606 |
| --- 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 |