File pycrypto-2.1.0-ssize.patch of Package python-crypto.564

--- src/hash_template.c
+++ src/hash_template.c
@@ -98,13 +98,15 @@
 	PyObject *value, *retval;
 	unsigned char *raw_digest, *hex_digest;
 	int i, j, size;
+    Py_ssize_t ssize;
 
 	if (!PyArg_ParseTuple(args, ""))
 		return NULL;
 
 	/* Get the raw (binary) digest value */
 	value = (PyObject *)hash_digest(&(self->st));
-	size = PyString_Size(value);
+	ssize = PyString_Size(value);
+    size = (ssize > INT_MAX) ? INT_MAX : ssize;
 	raw_digest = (unsigned char *) PyString_AsString(value);
 
 	/* Create a new string */