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: Wrong size calculation in posix_execve
Type: behavior Stage: test needed
Components: Extension Modules Versions: Python 3.1, Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, Rhamphoryncus, loewis, vstinner
Priority: normal Keywords:

Created on 2008-06-09 23:28 by Rhamphoryncus, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg67880 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2008-06-09 23:28
In 2.x, the size of C string needed for an environment variable used by
posix_execve was calculated using PyString_GetSize.  In 3.0 this is
translated to PyUnicode_GetSize.  However, in 3.0 the C string is the
UTF-8 encoded version of the unicode object, which doesn't necessarily
have the same length as what PyUnicode_GetSize reports.

The simplest solution I see is to use strlen() instead.
msg109895 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-10 17:08
Any core C developers have any input on this one?
msg109902 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-07-10 17:43
Yes, I fixed it in 3.1 (r80494) and 3.2 (r80421): see issue #8391.
History
Date User Action Args
2022-04-11 14:56:35adminsetgithub: 47320
2010-07-10 17:43:55vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg109902
2010-07-10 17:08:46BreamoreBoysetnosy: + BreamoreBoy

messages: + msg109895
versions: + Python 3.2
2009-05-13 22:34:38ajaksu2setversions: + Python 3.1, - Python 3.0
nosy: + loewis, vstinner

priority: normal
type: behavior
stage: test needed
2008-06-09 23:28:50Rhamphoryncuscreate