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 bltinmodule.c for 64-bit platforms
Type: Stage:
Components: None Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum, tmick
Priority: normal Keywords: patch

Created on 2000-06-07 03:21 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:21 None
Messages (7)
msg32761 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-07 03:21
 
msg32762 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2000-06-27 15:06
We'll have to trust Trent that this works on 64-bit Windows...
msg32763 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2000-06-28 21:13
OK. Note that the chakge to id() means that id() can now return a long -- this should normally be alright but it's possible that it could break code that expects an int. Good enough for a beta.
msg32764 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-07 03:21
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.
msg32765 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-07 03:21
Various small fixes to the builtin module to ensure no buffer overflows.

- chunk #1:
  Proper casting to ensure no truncation, and hence no surprises, in the
  comparison.

- chunk #2:
  The id() function guarantees a unique return value for different objects.
  It does this by returning the pointer to the object. By returning a PyInt,
  on Win64 (sizeof(long) < sizeof(void*)) the pointer is truncated and the
  guarantee may be proven false. The appropriate return function is
  PyLong_FromVoidPtr, this returns a PyLong if that is necessary to return
  the pointer without truncation.

- chunk #3:
  Ensure no overflow in raw_input(). Granted the user would have to pass in
  >2GB of data but it *is* a possible buffer overflow condition.
msg32766 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-27 15:56
Muuwaaaahhhaaaa!
-- member of live 32-bits or die

p.s. But, as a theoretical exercise, this looks okay to you I presume.
msg32767 - (view) Author: Trent Mick (tmick) (Python triager) Date: 2000-06-28 21:19
> Note that the chakge to id() means that id() can now 
> return a long -- this should normally be alright but
> it's possible that it could break code that expects an
> int

Yes, I asked Tim about that and he said, correctly, that the guarantee is only that an integral value is returned and that PyLong qualifies.
History
Date User Action Args
2022-04-10 16:02:00adminsetgithub: 32441
2000-06-07 03:21:01tmickcreate