/ Check-in [eebacbc9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:When a memory allocation fails on the %Q conversion in sqlite3_mprintf(), make sure the error is reported back up the call stack. (CVS 5933)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: eebacbc9d7d0625dfbe6367046fa4a0ca9c04e74
User & Date: drh 2008-11-20 18:20:28
Context
2008-11-22
14:07
Port the corruption bug fix of check-in (5938) into a branch off of version 3.6.6. (CVS 5947) check-in: 15d88edf user: drh tags: branch_3_6_6
2008-11-21
00:10
Added support for proxy file locking style Added pragma support for controlling proxy file locking Added file control access to last errno and proxy locking Added support for TMPDIR environment variable Extended unit tests to cover new proxy locking pragmas and file control features (CVS 5934) check-in: b9bc36d3 user: aswift tags: trunk
2008-11-20
18:20
When a memory allocation fails on the %Q conversion in sqlite3_mprintf(), make sure the error is reported back up the call stack. (CVS 5933) check-in: eebacbc9 user: drh tags: trunk
2008-11-19
21:35
In os_win.c, if SQLITE_TEST defined, winRandomness() should return all zeroes like os_unix.c. (CVS 5932) check-in: 00b68a1e user: shane tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/printf.c.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
641
642
643
644
645
646
647
648



649
650
651
652
653
654
655
/*
** The "printf" code that follows dates from the 1980's.  It is in
** the public domain.  The original comments are included here for
** completeness.  They are very out-of-date but might be useful as
** an historical reference.  Most of the "enhancements" have been backed
** out so that the functionality is now the same as standard printf().
**
** $Id: printf.c,v 1.95 2008/11/17 19:18:55 danielk1977 Exp $
**
**************************************************************************
**
** The following modules is an enhanced replacement for the "printf" subroutines
** found in the standard C library.  The following enhancements are
** supported:
**
................................................................................
        for(i=n=0; (ch=escarg[i])!=0; i++){
          if( ch==q )  n++;
        }
        needQuote = !isnull && xtype==etSQLESCAPE2;
        n += i + 1 + needQuote*2;
        if( n>etBUFSIZE ){
          bufpt = zExtra = sqlite3Malloc( n );
          if( bufpt==0 ) return;



        }else{
          bufpt = buf;
        }
        j = 0;
        if( needQuote ) bufpt[j++] = q;
        for(i=0; (ch=escarg[i])!=0; i++){
          bufpt[j++] = ch;







|







 







|
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
/*
** The "printf" code that follows dates from the 1980's.  It is in
** the public domain.  The original comments are included here for
** completeness.  They are very out-of-date but might be useful as
** an historical reference.  Most of the "enhancements" have been backed
** out so that the functionality is now the same as standard printf().
**
** $Id: printf.c,v 1.96 2008/11/20 18:20:28 drh Exp $
**
**************************************************************************
**
** The following modules is an enhanced replacement for the "printf" subroutines
** found in the standard C library.  The following enhancements are
** supported:
**
................................................................................
        for(i=n=0; (ch=escarg[i])!=0; i++){
          if( ch==q )  n++;
        }
        needQuote = !isnull && xtype==etSQLESCAPE2;
        n += i + 1 + needQuote*2;
        if( n>etBUFSIZE ){
          bufpt = zExtra = sqlite3Malloc( n );
          if( bufpt==0 ){
            pAccum->mallocFailed = 1;
            return;
          }
        }else{
          bufpt = buf;
        }
        j = 0;
        if( needQuote ) bufpt[j++] = q;
        for(i=0; (ch=escarg[i])!=0; i++){
          bufpt[j++] = ch;