diff options
author | drh <> | 2022-10-17 16:09:33 +0000 |
---|---|---|
committer | drh <> | 2022-10-17 16:09:33 +0000 |
commit | 8be89249012a556580737d9e7a6b1938bab9e02c (patch) | |
tree | cdd65fcd2daf3ff0c49ff4cc2402285b6fe4cbc3 /src | |
parent | cdc9ddc6ec28a475e20a86022de8f7d7d5331379 (diff) | |
download | sqlite-8be89249012a556580737d9e7a6b1938bab9e02c.tar.gz sqlite-8be89249012a556580737d9e7a6b1938bab9e02c.zip |
Fix a potential call to strlen() with a null argument in the command-line shell
following an OOM error. [forum:/forumpost/9c4f2ebe22|forum post 9c4f2ebe22].
FossilOrigin-Name: b6413a6dff8ac9b7088b1381afbbbf799e376455d11786530cc5fc825747ab53
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c.in | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shell.c.in b/src/shell.c.in index a83aab58a..1dbe349ef 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -1990,7 +1990,9 @@ static int wsToEol(const char *z){ */ static void eqp_append(ShellState *p, int iEqpId, int p2, const char *zText){ EQPGraphRow *pNew; - i64 nText = strlen(zText); + i64 nText; + if( zText==0 ) return; + nText = strlen(zText); if( p->autoEQPtest ){ utf8_printf(p->out, "%d,%d,%s\n", iEqpId, p2, zText); } |