Skip to content

Commit d034ec5

Browse files
Fix a compiler warning.
1 parent e6b642b commit d034ec5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/moduleobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ _PyModule_GetFilenameUTF8(PyObject *mod, char *buffer, size_t maxlen)
684684
}
685685
else {
686686
const char *filename = PyUnicode_AsUTF8AndSize(filenameobj, &size);
687-
if (size > maxlen) {
687+
if (size > PY_SIZE_MAX || (size_t)size > maxlen) {
688688
size = -1;
689689
PyErr_SetString(PyExc_ValueError, "__file__ too long");
690690
}

0 commit comments

Comments
 (0)