// No real reason to let people upload more than a 2MB image
private static final long MAX_IMAGE_SIZE = 2000000L;
// No real reason to let people upload more than a 2MB image
private static final long MAX_IMAGE_SIZE = 2000000L;
- // No real reason to deal with more than maybe 2.5 megapixels
- private static final int MAX_PIXELS = 1 << 16;
+ // No real reason to deal with more than maybe 2 megapixels
+ private static final int MAX_PIXELS = 1 << 21;
throws ServletException, IOException {
String imageURIString = request.getParameter("u");
if (imageURIString == null || imageURIString.length() == 0) {
throws ServletException, IOException {
String imageURIString = request.getParameter("u");
if (imageURIString == null || imageURIString.length() == 0) {
getResponse = client.execute(getRequest);
} catch (IllegalArgumentException iae) {
// Thrown if hostname is bad or null
getResponse = client.execute(getRequest);
} catch (IllegalArgumentException iae) {
// Thrown if hostname is bad or null
// javax.net.ssl.SSLPeerUnverifiedException,
// org.apache.http.NoHttpResponseException,
// org.apache.http.client.ClientProtocolException,
// javax.net.ssl.SSLPeerUnverifiedException,
// org.apache.http.NoHttpResponseException,
// org.apache.http.client.ClientProtocolException,
getRequest.abort();
response.sendRedirect("badurl.jspx");
return;
}
if (getResponse.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK) {
getRequest.abort();
response.sendRedirect("badurl.jspx");
return;
}
if (getResponse.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK) {
throws ServletException, IOException {
if (!ServletFileUpload.isMultipartContent(request)) {
throws ServletException, IOException {
if (!ServletFileUpload.isMultipartContent(request)) {
// Includes javax.imageio.IIOException
response.sendRedirect("badimage.jspx");
return;
} catch (CMMException cmme) {
// Includes javax.imageio.IIOException
response.sendRedirect("badimage.jspx");
return;
} catch (CMMException cmme) {
// Have seen this in logs
response.sendRedirect("badimage.jspx");
return;
} catch (IllegalArgumentException iae) {
// Have seen this in logs
response.sendRedirect("badimage.jspx");
return;
} catch (IllegalArgumentException iae) {