![]() |
![]() |
|
September 27, 2003An Overlooked Construct and an Integer Overflow ReduxHere is an interesting article from Michael on "An Overlooked Construct and an Integer Overflow Redux". It dawned on me I didn't post this earlier when I was showing Arc some code and he wasn't sure what my integer sentry counter for overflowing was doing. This article will put it into perspective for you. Anyways, as usual its a great article if you wish to learn how to code secure. Happy reading. Comments
Interesting that you post this, because this week I was reminded how easy it is to overrun an integer. In my situation it was with a database column in MySQL. The column was of type "Integer" which is int(11). This field contained values consisting of numbers stored bytes. Worked fine for a couple of days, but when some of the values were incremented to 2GB, it caused the db value to wrap around and do strange things. By changing the datatype to bigint (which is int(20)), byte values up to billions of TB can be stored. This issue was tricky to discover, because MySQL doesn't treat integer wraparounds as fatal errors; it just gives a warning. So by the time the problem was discovered, all the data in the db was inaccurate/unreliable. So the lesson of this story is to review variable/data types that others have come up with, and do some simple tests around the boundary conditions. Posted by: Wim at September 27, 2003 11:00 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
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 ![]() |
|