/ Check-in [05eba9e3]
Login

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

Overview
Comment:Fix the sqlite3GetInt32() function so that it correctly returns 0 on a zero-length input string.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 05eba9e3a5f9bb2a40af1dacd885e1915fbcd20b9af4cf0eed79ac16dbeba31b
User & Date: drh 2017-05-03 17:44:28
Context
2017-05-03
19:36
Remove the unused "sqlite3_stack_used" TCL command from the test harness. check-in: e24b7382 user: drh tags: trunk
17:44
Fix the sqlite3GetInt32() function so that it correctly returns 0 on a zero-length input string. check-in: 05eba9e3 user: drh tags: trunk
15:54
Always enable URI filenames when compiling with SQLITE_HAS_CODEC. Also allow plaintext keys using the key= query parameter. check-in: 31a51b4d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/util.c.

   709    709         memcpy(pValue, &u, 4);
   710    710         return 1;
   711    711       }else{
   712    712         return 0;
   713    713       }
   714    714     }
   715    715   #endif
          716  +  if( !sqlite3Isdigit(zNum[0]) ) return 0;
   716    717     while( zNum[0]=='0' ) zNum++;
   717    718     for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){
   718    719       v = v*10 + c;
   719    720     }
   720    721   
   721    722     /* The longest decimal representation of a 32 bit integer is 10 digits:
   722    723     **