Thanks but doesn't that code check to see if the database pointer has changed 
and not whether the memory it references has been corrupted? I guess that's a 
start though.

Rick



On Jul 19, 2012, at 11:02 AM, Black, Michael (IS) wrote:

> Buffer overflow issues can cause problems at seemingly random points in a 
> program.  I've worked on some really nasty ones before when no debugging was 
> available.
> 
> 
> 
> If dbRef is being corrupted then put a dbRef check in your program in every 
> function at beginning and end.
> 
> 
> 
> int dbRefCheck(sqlite3 *dbRef)
> 
> {
> 
>  static sqlite3 *mydbRef;
> 
>  if (dbRef == NULL) mydbRef = dbRef;
> 
>  if (dbRef != mydbRef) return true;
> 
>  return false;
> 
> }
> 
> 
> 
> if (dbRefCheck(dbRef)) {
> 
>  // error output -- with FILE and LINE macros if you have them.  Otherwise 
> some other unique id for each call so you know where it's happening.
> 
> }
> 

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to