--- Joe Wilson <[EMAIL PROTECTED]> wrote:
> A quick check in a few of the .c files turn up 64 bit assumptions
> in sqlite3VdbeSerialType, sqlite3VdbeSerialGet and anything related
> to floating point number support.

Upon closer inspection, if a database did not use any 64 bit integer 
values or floating point numbers then sqlite3VdbeSerialType and 
sqlite3VdbeSerialGet may not encounter the 64-bit specific code 
(for 6-byte and 8-byte integer encodings).

sqlite3atoi64() obviously deals with 64 bit integers, but parsing
a number greater than a 32 bit integer with the i64 set to a 
32-bit int type would only result in a wrong result, not a crash.

In sqlite3PutVarint, if u64 is actually defined/typedef'd as 
a 32 bit unsigned integer, then performing <<32 yields an 
undefined value by the C standard:

  int sqlite3PutVarint(unsigned char *p, u64 v){
    int i, j, n;
    u8 buf[10];
    if( v & (((u64)0xff000000)<<32) ){

  ~$ cat b.c
  #include <stdio.h>
  int left31(int a) { return a << 31; }
  int left32(int a) { return a << 32; }
  main() {
    int v = 0xff000000;
    printf("%08x\n", left31(v));
    printf("%08x\n", left32(v));
  }
  ~$ gcc  b.c -o b
  b.c: In function `left32':
  b.c:3: warning: left shift count >= width of type
  ~$ ./b
  00000000
  ff000000

But try adding -DSQLITE_OMIT_FLOATING_POINT=1 to your compile and see
what happens.


 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to