Hello All,

    In reviewing code in sqlite 3.8.11.1, I found a pair of calls to
sqlite3_realloc64() which upon return are NOT checked for a return
value of NULL, indicating failure.  The patch file below should
correct this issue:

=======================================================================

--- shell.c.orig    2015-08-22 18:33:38.146000000 -0700
+++ shell.c    2015-08-22 18:36:40.848000000 -0700
@@ -1441,6 +1441,10 @@
       p->aiIndent = (int*)sqlite3_realloc64(p->aiIndent,
nAlloc*sizeof(int));
       abYield = (int*)sqlite3_realloc64(abYield, nAlloc*sizeof(int));
     }
+    if ( !p->aiIndent || !abYield ){
+      fprintf(stderr, "out of memory\n");
+      exit(1);
+    }
     abYield[iOp] = str_in_array(zOp, azYield);
     p->aiIndent[iOp] = 0;
     p->nIndent = iOp+1;


=======================================================================

I am attaching the patch file to this bug report...

Questions, Comments, Suggestions, Complaints? :)

Bill Parker (wp02855 at gmail dot com)

Reply via email to