/ Check-in [62b4891b]
Login

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

Overview
Comment:Apply fix [9b8acf8319] to the 3.6.1 branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.6.1
Files: files | file ages | folders
SHA1:62b4891b155ae566006236fee368794eabcd71a3
User & Date: dan 2010-01-05 18:11:53
Context
2010-02-23
10:50
Fix a segfault that can occur if a malloc fails in ATTACH in shared-cache mode. check-in: d6343d03 user: dan tags: branch-3.6.1
2010-01-05
18:11
Apply fix [9b8acf8319] to the 3.6.1 branch. check-in: 62b4891b user: dan tags: branch-3.6.1
18:06
Apply fix [097737e368] to the 3.6.1 branch. check-in: 9f819ea6 user: dan tags: branch-3.6.1
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  1127   1127   
  1128   1128   #ifndef SQLITE_OMIT_UTF16
  1129   1129   /*
  1130   1130   ** Return UTF-16 encoded English language explanation of the most recent
  1131   1131   ** error.
  1132   1132   */
  1133   1133   const void *sqlite3_errmsg16(sqlite3 *db){
  1134         -  /* Because all the characters in the string are in the unicode
  1135         -  ** range 0x00-0xFF, if we pad the big-endian string with a 
  1136         -  ** zero byte, we can obtain the little-endian string with
  1137         -  ** &big_endian[1].
  1138         -  */
  1139         -  static const char outOfMemBe[] = {
  1140         -    0, 'o', 0, 'u', 0, 't', 0, ' ', 
  1141         -    0, 'o', 0, 'f', 0, ' ', 
  1142         -    0, 'm', 0, 'e', 0, 'm', 0, 'o', 0, 'r', 0, 'y', 0, 0, 0
         1134  +  static const u16 outOfMem[] = {
         1135  +    'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
  1143   1136     };
  1144         -  static const char misuseBe [] = {
  1145         -    0, 'l', 0, 'i', 0, 'b', 0, 'r', 0, 'a', 0, 'r', 0, 'y', 0, ' ', 
  1146         -    0, 'r', 0, 'o', 0, 'u', 0, 't', 0, 'i', 0, 'n', 0, 'e', 0, ' ', 
  1147         -    0, 'c', 0, 'a', 0, 'l', 0, 'l', 0, 'e', 0, 'd', 0, ' ', 
  1148         -    0, 'o', 0, 'u', 0, 't', 0, ' ', 
  1149         -    0, 'o', 0, 'f', 0, ' ', 
  1150         -    0, 's', 0, 'e', 0, 'q', 0, 'u', 0, 'e', 0, 'n', 0, 'c', 0, 'e', 0, 0, 0
         1137  +  static const u16 misuse[] = {
         1138  +    'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
         1139  +    'r', 'o', 'u', 't', 'i', 'n', 'e', ' ',
         1140  +    'c', 'a', 'l', 'l', 'e', 'd', ' ',
         1141  +    'o', 'u', 't', ' ',
         1142  +    'o', 'f', ' ',
         1143  +    's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', 0
  1151   1144     };
  1152   1145   
  1153   1146     const void *z;
  1154   1147     if( !db ){
  1155         -    return (void *)(&outOfMemBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
         1148  +    return (void *)outOfMem;
  1156   1149     }
  1157   1150     if( !sqlite3SafetyCheckSickOrOk(db) ){
  1158         -    return (void *)(&misuseBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
         1151  +    return (void *)misuse;
  1159   1152     }
  1160   1153     sqlite3_mutex_enter(db->mutex);
  1161   1154     assert( !db->mallocFailed );
  1162   1155     z = sqlite3_value_text16(db->pErr);
  1163   1156     if( z==0 ){
  1164   1157       sqlite3ValueSetStr(db->pErr, -1, sqlite3ErrStr(db->errCode),
  1165   1158            SQLITE_UTF8, SQLITE_STATIC);