A useful primer to Integer overflows/underflows


From a presentation by a security contractor on campus:



1 bottle of beer on the wall, 1 bottle of beer, you take 1 down, pass it around, 0 bottles of beer on the wall.


0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.


Funny! But it shows analogies between software and the physical world are rarely good!

Comments (5)

  1. MSDNArchive says:

    Yes, it’s a bad analogy. But it’s pretty funny. I’m sure there’s some kind of beer/underflow pun here, too, but I’m not gonna touch it.

    – Drew

  2. Jmonkey says:

    I bet a beer company would look up to that one…sure would cause a bottleneck. Really would bring up the cache! Ok…korny, but it had to come out of my memory before it crashed.

  3. Web Resources

    [.NET Framework] GotDotNet CodeGallery

    Share, find, download and discuss evolving…

  4. alik levin's says:

    Although Michael Howard has some arguments about comparing software stuff with physical world I will