This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: overflow checking for modification time (64-bit, import.c)
Type: Stage:
Components: None Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, tim.peters, tmick
Priority: normal Keywords: patch

Created on 2000-06-07 02:51 by tmick, last changed 2022-04-10 16:02 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
None tmick, 2000-06-07 02:51 None
Messages (5)
msg32703 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-07 02:51
 
msg32704 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2000-06-30 16:23
Checked in verbatim.
msg32705 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2000-06-30 00:23
Hey!  I can review these in my sleep now <wink>!
Accepted & passed back to Trent.
msg32706 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-07 02:52
I confirm that, to the best of my knowledge and belief, this
contribution is free of any claims of third parties under
copyright, patent or other rights or interests ("claims").  To
the extent that I have any such claims, I hereby grant to CNRI a
nonexclusive, irrevocable, royalty-free, worldwide license to
reproduce, distribute, perform and/or display publicly, prepare
derivative versions, and otherwise use this contribution as part
of the Python software and its related documentation, or any
derivative versions thereof, at no cost to CNRI or its licensed
users, and to authorize others to do so.

I acknowledge that CNRI may, at its sole discretion, decide
whether or not to incorporate this contribution in the Python
software and its related documentation.  I further grant CNRI
permission to use my name and other identifying information
provided to CNRI by me for use in connection with the Python
software and its related documentation.
msg32707 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-07 02:53
This patch fixes possible overflow in the use of PyOS_GetLastModificationTime
in getmtime.c and Python/import.c.

Currently PyOS_GetLastModificationTime returns a C long. This can overflow on
Win64 where sizeof(time_t) > sizeof(long). Besides it should logically return
a time_t anyway (this patch changes this).

As well, import.c uses PyOS_GetLastModificationTime for .pyc timestamping.
There has been recent discussion about the .pyc header format on python-dev.
This patch adds oveflow checking to import.c so that an exception will be
raised if the modification time overflows. There are a few other minor 64-bit
readiness changes made to the module as well:
 - size_t instead of int or long for function-local buffer and string length
   variables
 - one buffer overflow check was added (raises an exception on possible
   overflow, this overflow chance exists on 32-bit platforms as well), no
   other possible buffer overflows existed (from my analysis anyway)
History
Date User Action Args
2022-04-10 16:02:00adminsetgithub: 32432
2000-06-07 02:51:53tmickcreate