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

Wrong size calculation in posix_execve #47320

Closed
Rhamphoryncus mannequin opened this issue Jun 9, 2008 · 3 comments
Closed

Wrong size calculation in posix_execve #47320

Rhamphoryncus mannequin opened this issue Jun 9, 2008 · 3 comments
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@Rhamphoryncus
Copy link
Mannequin

Rhamphoryncus mannequin commented Jun 9, 2008

BPO 3070
Nosy @loewis, @vstinner

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 = None
closed_at = <Date 2010-07-10.17:43:55.509>
created_at = <Date 2008-06-09.23:28:50.480>
labels = ['extension-modules', 'type-bug']
title = 'Wrong size calculation in posix_execve'
updated_at = <Date 2010-07-10.17:43:55.507>
user = 'https://bugs.python.org/Rhamphoryncus'

bugs.python.org fields:

activity = <Date 2010-07-10.17:43:55.507>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2010-07-10.17:43:55.509>
closer = 'vstinner'
components = ['Extension Modules']
creation = <Date 2008-06-09.23:28:50.480>
creator = 'Rhamphoryncus'
dependencies = []
files = []
hgrepos = []
issue_num = 3070
keywords = []
message_count = 3.0
messages = ['67880', '109895', '109902']
nosy_count = 4.0
nosy_names = ['loewis', 'Rhamphoryncus', 'vstinner', 'BreamoreBoy']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'test needed'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue3070'
versions = ['Python 3.1', 'Python 3.2']

@Rhamphoryncus
Copy link
Mannequin Author

Rhamphoryncus mannequin commented Jun 9, 2008

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.

@Rhamphoryncus Rhamphoryncus mannequin added the extension-modules C modules in the Modules dir label Jun 9, 2008
@devdanzin devdanzin mannequin added the type-bug An unexpected behavior, bug, or error label May 13, 2009
@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Jul 10, 2010

Any core C developers have any input on this one?

@vstinner
Copy link
Member

Yes, I fixed it in 3.1 (r80494) and 3.2 (r80421): see issue bpo-8391.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant