![]() |
![]() |
|
May 30, 2006Have you ever had one of those days?Oh man... sometimes you just want to grab a keyboard and smack yourself up side the head. Ok, so time for a little secret.... I'm human. And I can be dumb at times. Not "doh.. I am so smart, 's-m-r-t' smart" kinda dumb. Actual "Dana you should know better" dumb. Recently found a bug I had in an failure code path which in all accounts, was missed in testing. During a database insertion, I would validate the data. Makes sense, always good to validate the data. One problem. One of the validation checks is to escape single quotes. Ya, except I forgot to call that validation against one of the fields. *sigh* But that wasn't the dumb-dumb part. What compounded this problem was the fact that this was all done in a database transaction. On failure I would call a rollback, like all good database insertions should. Now for the dumb part... the audit log for this failure... was being inserted into the database in the same bloody transaction. ARGGGGGGGGG. So even though I thought I was being smart in putting the audit log in the failure code path, on a rollback the failed event wasn't inserted into the audit log table at all. No wonder no one caught this. Gosh I feel dumb. I think I will go crawl into a hole for a bit while the scolding and heckling commenses. I should know better than this. Moral of the story: ALWAYS test all failure code paths, and make sure code coverage can prove you are going down that tree. Posted by SilverStr at May 30, 2006 10:39 AM | TrackBackComments
Always there's a smart-arse who asks you "what if you have an error in your error-handling code?", and you usually have to say "at that point, we drop everything". At least, that's the polite way to deal with it. P.S. You mis-spelled "commences" :-) Posted by: Alun Jones at June 1, 2006 03:46 PMI think it counts as both :P And muh spelun is gust fine thank ya very much. Ok, maybe not. I wish MT had spell check *sigh* Posted by: Dana Epp at June 1, 2006 04:04 PM |
![]() ![]()
My 5 Favorite Books
Writing Secure Code
Secure Programming Cookbook Security Engineering Secure Coding Principles & Practice Inside the Security Mind ![]()
My 5 Favorite Papers
Smashing the Stack
Penetration Studies Covert Channel Analysis of Trusted Systems DoD Trusted Computer System Evaluation Criteria NSA Security Recommendation Guides ![]()
Archives
July 2008
June 2008 April 2008 January 2008 December 2007 November 2007 October 2007 September 2007 August 2007 July 2007 June 2007 May 2007 April 2007 March 2007 February 2007 January 2007 December 2006 November 2006 October 2006 September 2006 August 2006 July 2006 June 2006 May 2006 April 2006 March 2006 February 2006 January 2006 December 2005 November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 February 2005 January 2005 December 2004 November 2004 October 2004 September 2004 August 2004 July 2004 June 2004 May 2004 April 2004 March 2004 February 2004 January 2004 December 2003 November 2003 October 2003 September 2003 August 2003 July 2003 June 2003 May 2003 April 2003 March 2003 February 2003 January 2003 December 2002 November 2002 October 2002 September 2002 August 2002 July 2002 ![]() |
|