Title: Add missing autoreset in Packer.pack_ext_type by bysiber · Pull Request #663 · msgpack/msgpack-python · GitHub
Open Graph Title: Add missing autoreset in Packer.pack_ext_type by bysiber · Pull Request #663 · msgpack/msgpack-python
X Title: Add missing autoreset in Packer.pack_ext_type by bysiber · Pull Request #663 · msgpack/msgpack-python
Description: Packer.pack_ext_type() writes to the internal buffer but never checks self._autoreset. Every other public pack method (pack, pack_map_pairs, pack_array_header, pack_map_header) has this pattern: if self._autoreset: ret = self._buffer.getvalue() self._buffer = BytesIO() return ret Without it, pack_ext_type() always returns None, and the packed ext data stays in the buffer. The next call to pack() then returns both the extension data and the new value concatenated together, corrupting the serialized stream. packer = msgpack.Packer() result = packer.pack_ext_type(5, b'\x01\x02\x03') # result is None, expected bytes packer.pack(99) # Returns 7 bytes (ext header + ext data + int) instead of 1 byte
Open Graph Description: Packer.pack_ext_type() writes to the internal buffer but never checks self._autoreset. Every other public pack method (pack, pack_map_pairs, pack_array_header, pack_map_header) has this pattern: if...
X Description: Packer.pack_ext_type() writes to the internal buffer but never checks self._autoreset. Every other public pack method (pack, pack_map_pairs, pack_array_header, pack_map_header) has this pattern: if...
Opengraph URL: https://github.com/msgpack/msgpack-python/pull/663
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:795a73ff-fbb3-6059-9b63-45d5787b134c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B4BE:1A86C7:222C52:2D9FCD:6A52C68D |
| html-safe-nonce | 9420ccb38a0760c6f861df6c4585041b96f81db7399ee8a6225190ca82ac6016 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNEJFOjFBODZDNzoyMjJDNTI6MkQ5RkNEOjZBNTJDNjhEIiwidmlzaXRvcl9pZCI6IjMxNDEwMTU2ODM5MjU3MjI3NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8e58d5b2464de5b321e99fcd9987f825096aaf6a8e58f4c7abd5187073532bc9 |
| hovercard-subject-tag | pull_request:3307604098 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/msgpack/msgpack-python/pull/663/files |
| twitter:image | https://avatars.githubusercontent.com/u/101993364?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/101993364?s=400&v=4 |
| og:image:alt | Packer.pack_ext_type() writes to the internal buffer but never checks self._autoreset. Every other public pack method (pack, pack_map_pairs, pack_array_header, pack_map_header) has this pattern: if... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/msgpack/msgpack-python git https://github.com/msgpack/msgpack-python.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 2242705 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2242705 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-python |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width