Making sure the 'size' CGI argument is below a maximum value.

The previous code can be made execute with any value for the integer 'size' argument.
That can trigger a denial-of-service for large values of 'size'.