protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

python: invalid uint32_t value convertion

Open alxn1 opened this issue 9 months ago • 3 comments

Version: 27.0-rc1 (and older versions, up to 624d29d commit, but maybe i'm wrong). Language: Python OS: Linux Python 3.11, protobuf installed from pip with --cpp_implementation flag

Big uint32_t values from protobuf (encoded by C++ code) from python side is are negative And problem is here: PyLong_FromSsize_t should be replaced by PyLong_FromUnsignedLong (or PyLong_FromSize_t, i'm not sure).

alxn1 avatar Apr 30 '24 11:04 alxn1

Thank you Alexander to raise it up. Can you help to give an example code to show the bug?

anandolee avatar May 16 '24 23:05 anandolee

I'm sorry, i did forget about one thing: it's but affects only 32-bit platforms like i386/arm32 :( But i did reproduce it with simple examples and little bit of docker magic: protobuf_bug_example.tar.gz This archive contains simple C++ message generator and python message parser which check parsed uint32 value from message; Dockerfile for environment build and run.sh, which run all this stuff properly.

alxn1 avatar May 24 '24 19:05 alxn1

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.

github-actions[bot] avatar Aug 23 '24 10:08 github-actions[bot]

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

github-actions[bot] avatar Sep 07 '24 10:09 github-actions[bot]