int overflow


I haven’t posted anything for a while as the result of a bad case of integer overflow.

Many months ago, I thought I’d dust of the old photo gallery and upload some more photos. After numerous failures I realized PHP has a POST limit of only 4 MB and I was trying to upload 5MB+ photos. This took me quite a while to work out, as it failed without an error. I thought a good solution was to up the limit to something big. 2GB should be more than enough for anyone!

When that still didn’t work I just gave up and posted the photos somewhere else.

Little did I know that I’d just broken almost everything php on that server. It took a couple of months before I finally realized that the max size of an int on this platform is about 2 billion… and  post_max_size = 2048M in php.ini actually wraps to -2048MB or so. duh.

So back to it!

  1. No comments yet.
(will not be published)