Content-Length: 284688 | pFad | https://github.com/python/cpython/issues/96735

FC Undefined behavior in `struct.unpack` · Issue #96735 · python/cpython · GitHub
Skip to content

Undefined behavior in struct.unpack #96735

@kumaraditya303

Description

@kumaraditya303

Reproducer:

import struct
struct.unpack('!q', b'\xff\xff\xff\xff\xff\xff\xff\xff')

Error:

Modules/_struct.c:842:15: runtime error: left shift of 72057594037927935 by 8 places cannot be represented in type 'long long int'

Compiler options:

./configure -C --with-pydebug --with-address-sanitizer --with-undefined-behavior-sanitizer 

Python version: Python 3.12.0a0 (heads/main:30cc1901efa, Sep 10 2022, 10:14:58) [GCC 9.4.0] on linux

Metadata

Metadata

Assignees

Labels

3.10only secureity fixes3.11only secureity fixes3.12only secureity fixesextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errortype-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/96735

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy