aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-07-14 22:43:37 +0000
committerdrh <drh@noemail.net>2015-07-14 22:43:37 +0000
commita8dbd52abbc0579601e3e56aa43ba03077054fb9 (patch)
tree2fcb5f5c73db8217d72205a6f864d75f1bf0e148 /src
parentbc50bb7f53a562d5669fdc6240e23e17175b63b0 (diff)
downloadsqlite-a8dbd52abbc0579601e3e56aa43ba03077054fb9.tar.gz
sqlite-a8dbd52abbc0579601e3e56aa43ba03077054fb9.zip
Amplify the comment on renderLogMsg() that explains the problems associated
with calling sqlite3_log() from deep within the memory allocator. FossilOrigin-Name: a73d7128fbca8dde5e90bd46ee915e39ae07dd1f
Diffstat (limited to 'src')
-rw-r--r--src/printf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/printf.c b/src/printf.c
index 72b9497d7..018df412f 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -1012,6 +1012,11 @@ char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
** sqlite3_log() must render into a static buffer. It cannot dynamically
** allocate memory because it might be called while the memory allocator
** mutex is held.
+**
+** sqlite3VXPrintf() might ask for *temporary* memory allocations for
+** certain format characters (%q) or for very large precisions or widths.
+** Care must be taken that any sqlite3_log() calls that occur while the
+** memory mutex is held do not use these mechanisms.
*/
static void renderLogMsg(int iErrCode, const char *zFormat, va_list ap){
StrAccum acc; /* String accumulator */