mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	Fix possible integer overflow
This commit is contained in:
		
							parent
							
								
									74ce856515
								
							
						
					
					
						commit
						86afcfd8f9
					
				| 
						 | 
					@ -1420,7 +1420,7 @@ _putdata(ImagingObject* self, PyObject* args)
 | 
				
			||||||
    image = self->image;
 | 
					    image = self->image;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    n = PyObject_Length(data);
 | 
					    n = PyObject_Length(data);
 | 
				
			||||||
    if (n > (Py_ssize_t) (image->xsize * image->ysize)) {
 | 
					    if (n > (Py_ssize_t)image->xsize * (Py_ssize_t)image->ysize) {
 | 
				
			||||||
        PyErr_SetString(PyExc_TypeError, "too many data entries");
 | 
					        PyErr_SetString(PyExc_TypeError, "too many data entries");
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user