Hmmm...somebody might need to point out what elements remain static.
So may not be able to do the whole structure like that. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems ________________________________ From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Black, Michael (IS) [michael.bla...@ngc.com] Sent: Thursday, July 19, 2012 12:15 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] EXT :Re: Getting occasional crashes with sqlite3_prepare_v2 and sqlite3_step in iOS app It could easiliy be expanded to look at the whole structure... Or just do an XOR checksum on the bytes in sizeof(sqlite3) and compare that. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems ________________________________ From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Rick Maddy [rma...@gmail.com] Sent: Thursday, July 19, 2012 12:11 PM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Getting occasional crashes with sqlite3_prepare_v2 and sqlite3_step in iOS app 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 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users