Skip to content

Wrong size calculation in posix_execve #47320

Closed

Description

@Rhamphoryncus
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']

Activity

  1. Rhamphoryncus commented on Jun 9, 2008

    Rhamphoryncusmannequin
    MannequinAuthor

    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.

  2. BreamoreBoy commented on Jul 10, 2010

    BreamoreBoymannequin
    Mannequin

    Any core C developers have any input on this one?

  3. vstinner commented on Jul 10, 2010

    @vstinner
    Member

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

  4. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions