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: fix up msvcrtmodule.c and winreg.c for Win64
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 03:16 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 03:16 None
Messages (6)
msg32755 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-07 03:16
 
msg32756 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2000-06-30 18:05
Checked in without testing since I don't have Windows running at the moment.  The changes to winreg.c were made to _winreg.c since that file was renamed.
msg32757 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2000-06-28 21:16
Accepted & assigned back to Trent.
msg32758 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-07 03:17
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.
msg32759 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-07 03:17
This patch fixes possible overflows in the socket module for 64-bit platforms
(mainly Win64). The changes are:

- abstract the socket type to SOCKET_T (this is SOCKET on Windows, int on
  Un*x), this is necessary because sizeof(SOCKET) > sizeof(int) on Win64
- use INVALID_SOCKET on Win32/64 for an error return value for accept()
- ensure no overflow of the socket variable for: (1) a PyObject return value
  (use PyLong_FromLongLong if necessary); and (2) printf formatting in repr()
msg32760 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-07 03:19
*** Ignore the last comment, that is not what this patch does at all. Rather: ***

Fix PC/msvcrtmodule.c and PC/winreg.c for Win64. Basically:

- sizeof(HKEY) > sizeof(long) on Win64, so use PyLong_FromVoidPtr() instead of
  PyInt_FromLong() to return HKEY values on Win64

- Check for string overflow of an arbitrary registry value (I know that
  ensuring that a registry value does not overflow 2**31 characters seems
  ridiculous but it is *possible*).
History
Date User Action Args
2022-04-10 16:02:00adminsetgithub: 32440
2000-06-07 03:16:55tmickcreate