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

undefined array passed to CryptGenRandomBytes #47637

Closed
kristjanvalur mannequin opened this issue Jul 16, 2008 · 2 comments
Closed

undefined array passed to CryptGenRandomBytes #47637

kristjanvalur mannequin opened this issue Jul 16, 2008 · 2 comments
Assignees
Labels
easy interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@kristjanvalur
Copy link
Mannequin

kristjanvalur mannequin commented Jul 16, 2008

BPO 3387
Nosy @amauryfa, @kristjanvalur
Files
  • tmp6.patch: patch for issue
  • 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/amauryfa'
    closed_at = <Date 2008-07-21.21:14:57.649>
    created_at = <Date 2008-07-16.22:59:41.759>
    labels = ['interpreter-core', 'easy']
    title = 'undefined array passed to CryptGenRandomBytes'
    updated_at = <Date 2008-07-21.21:14:57.610>
    user = 'https://github.com/kristjanvalur'

    bugs.python.org fields:

    activity = <Date 2008-07-21.21:14:57.610>
    actor = 'amaury.forgeotdarc'
    assignee = 'amaury.forgeotdarc'
    closed = True
    closed_date = <Date 2008-07-21.21:14:57.649>
    closer = 'amaury.forgeotdarc'
    components = ['Interpreter Core']
    creation = <Date 2008-07-16.22:59:41.759>
    creator = 'kristjan.jonsson'
    dependencies = []
    files = ['10919']
    hgrepos = []
    issue_num = 3387
    keywords = ['patch', 'easy']
    message_count = 2.0
    messages = ['69853', '70118']
    nosy_count = 2.0
    nosy_names = ['amaury.forgeotdarc', 'kristjan.jonsson']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3387'
    versions = ['Python 2.6', 'Python 2.5', 'Python 3.0']

    @kristjanvalur
    Copy link
    Mannequin Author

    kristjanvalur mannequin commented Jul 16, 2008

    The CryptGenRandomBytes uses whatever data is already in the buffer as
    seed for the output. So, the buffer is effectively an in/out buffer.
    Now, since we are generating random data anyway, the fact that we are
    using an undefined seed for the data shouldn't matter. However, this
    does create a bunch of false positives for analysis tools such as
    Purify, that track the copying and usage of uninitialized data.
    An easy patch is to clear the buffer before submitting it to
    CryptGenRandomBytes, and is attached.

    @kristjanvalur kristjanvalur mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) easy labels Jul 16, 2008
    @amauryfa amauryfa self-assigned this Jul 21, 2008
    @amauryfa
    Copy link
    Member

    Committed as r65174 and r65175.
    (for trunk, I had to change PyBytes_AS_STRING into PyString_AS_STRING)
    Thanks!

    @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
    easy interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant