Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix up msvcrtmodule.c and winreg.c for Win64 #32440

Closed
tmick mannequin opened this issue Jun 7, 2000 · 6 comments
Closed

fix up msvcrtmodule.c and winreg.c for Win64 #32440

tmick mannequin opened this issue Jun 7, 2000 · 6 comments
Assignees

Comments

@tmick
Copy link
Mannequin

tmick mannequin commented Jun 7, 2000

BPO 400517
Nosy @tim-one, @freddrake
Files
  • None: None
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/freddrake'
    closed_at = <Date 2000-06-30.18:05:23.000>
    created_at = <Date 2000-06-07.03:16:55.000>
    labels = []
    title = 'fix up msvcrtmodule.c and winreg.c for Win64'
    updated_at = <Date 2000-06-30.18:05:23.000>
    user = 'https://bugs.python.org/tmick'

    bugs.python.org fields:

    activity = <Date 2000-06-30.18:05:23.000>
    actor = 'fdrake'
    assignee = 'fdrake'
    closed = True
    closed_date = None
    closer = None
    components = ['None']
    creation = <Date 2000-06-07.03:16:55.000>
    creator = 'tmick'
    dependencies = []
    files = ['2448']
    hgrepos = []
    issue_num = 400517
    keywords = ['patch']
    message_count = 6.0
    messages = ['32755', '32756', '32757', '32758', '32759', '32760']
    nosy_count = 3.0
    nosy_names = ['tim.peters', 'fdrake', 'tmick']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue400517'
    versions = []

    @tmick
    Copy link
    Mannequin Author

    tmick mannequin commented Jun 7, 2000

    No description provided.

    @tmick tmick mannequin closed this as completed Jun 7, 2000
    @tmick tmick mannequin assigned freddrake Jun 7, 2000
    @tmick tmick mannequin closed this as completed Jun 7, 2000
    @tmick tmick mannequin assigned freddrake Jun 7, 2000
    @tmick
    Copy link
    Mannequin Author

    tmick mannequin commented Jun 7, 2000

    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.

    @tmick
    Copy link
    Mannequin Author

    tmick mannequin commented Jun 7, 2000

    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()

    @tmick
    Copy link
    Mannequin Author

    tmick mannequin commented Jun 7, 2000

    *** 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*).

    @tim-one
    Copy link
    Member

    tim-one commented Jun 28, 2000

    Accepted & assigned back to Trent.

    @freddrake
    Copy link
    Member

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants