Make sure that at least one digit has been consumed in atoi().
diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c
index 2d11851..73a35c9 100644
--- a/Modules/stropmodule.c
+++ b/Modules/stropmodule.c
@@ -705,6 +705,10 @@
 		x = (long) PyOS_strtoul(s, &end, base);
 	else
 		x = PyOS_strtol(s, &end, base);
+	if (end == s || !isxdigit(end[-1])) {
+		PyErr_SetString(PyExc_ValueError, "no digits in int constant");
+		return NULL;
+	}
 	while (*end && isspace(Py_CHARMASK(*end)))
 		end++;
 	if (*end != '\0') {