/ Check-in [1fe9ca07]
Login

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

Overview
Comment:Reduce the size of a memory allocation in the windows driver to the minimum needed. Ticket #1690. (CVS 3115)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1fe9ca078b77b79ac738a095d8d4c82ae0926286
User & Date: drh 2006-02-27 23:44:36
Context
2006-03-02
03:02
Change the ROUND() function to return a REAL value instead of TEXT. Ticket #1699. (CVS 3116) check-in: 9dbadfb2 user: drh tags: trunk
2006-02-27
23:44
Reduce the size of a memory allocation in the windows driver to the minimum needed. Ticket #1690. (CVS 3115) check-in: 1fe9ca07 user: drh tags: trunk
23:19
Add a test to make sure parser stack overflow is detected and reported. (CVS 3114) check-in: 201ab3b5 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

   124    124   #endif /* OS_WINCE */
   125    125   
   126    126   /*
   127    127   ** Convert a UTF-8 string to UTF-32.  Space to hold the returned string
   128    128   ** is obtained from sqliteMalloc.
   129    129   */
   130    130   static WCHAR *utf8ToUnicode(const char *zFilename){
   131         -  int nByte;
          131  +  int nChar;
   132    132     WCHAR *zWideFilename;
   133    133   
   134    134     if( !isNT() ){
   135    135       return 0;
   136    136     }
   137         -  nByte = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0)*sizeof(WCHAR);
   138         -  zWideFilename = sqliteMalloc( nByte*sizeof(zWideFilename[0]) );
          137  +  nChar = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0);
          138  +  zWideFilename = sqliteMalloc( nChar*sizeof(zWideFilename[0]) );
   139    139     if( zWideFilename==0 ){
   140    140       return 0;
   141    141     }
   142         -  nByte = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, zWideFilename, nByte);
   143         -  if( nByte==0 ){
          142  +  nChar = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, zWideFilename, nChar);
          143  +  if( nChar==0 ){
   144    144       sqliteFree(zWideFilename);
   145    145       zWideFilename = 0;
   146    146     }
   147    147     return zWideFilename;
   148    148   }
   149    149   
   150    150   /*