Greetings,

I think I found a small bug in sqlite 3.6.22 in the function proxyGetHostID(). 

There, pread() and pwrite() are used to read a host id file. Return value of 
these functions is assigned to a size_t variable. size_t is unsigned. Should 
pread fail for any reason (IO Error or whatever) and return -1, the error 
handling would not kick in. Instead, the function would probably just leave the 
host id uninitialized and return ok.

A valid fix might be using ssize_t (signed size_t) instead of size_t, but I 
cannot of course say whether this would work on all platforms.

My Platform is MacOS X, I compile with gcc 4.2. I compile the amalgamation for 
sqlite 3.6.22. I only found this because gcc warns:

sqlite3.c:26120: warning: comparison of unsigned expression < 0 is always false
sqlite3.c:26134: warning: comparison of unsigned expression < 0 is always false 


Kind Regards, 

Thomas Stüfe
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to