1. pygame
  2. Untitled project
  3. pygame

Commits

pygame  committed 15089aa

fix longs overflowing ints

  • Participants
  • Parent commits 53acbf2
  • Branches default

Comments (0)

Files changed (2)

File WHATSNEW

View file
  • Ignore whitespace
 # BREAK = change breaks existing code
 # BUG	= fixed a bug that was (or could have been) crashing
 
+February 9, 2004
+    help protect int overflow
+
 December 25, 2003
     sprite groups are now iterators
     SysFont better unix parsing

File src/base.c

View file
  • Ignore whitespace
 	if(PyNumber_Check(obj))
 	{
 		if(!(intobj = PyNumber_Int(obj)))
+                {
+                        PyErr_Clear();
 			return 0;
+                }
 		*val = PyInt_AsLong(intobj);
 		Py_DECREF(intobj);
+                if(PyErr_Occurred())
+                {
+                    PyErr_Clear();
+                    return 0;
+                }
 		return 1;
 	}
 	return 0;