( )⚙ D11334 revlog: fix type confusion with sidedata_comp_len (issue 6580)

This is an archive of the discontinued Mercurial Phabricator instance.

revlog: fix type confusion with sidedata_comp_len (issue 6580)
ClosedPublic

Authored by jcristau on Aug 24 2021, 6:44 AM.

Details

Summary

The format string uses "i" (int) for sidedata_comp_len, so we shouldn't
be passing a pointer to Py_ssize_t to PyArg_ParseTuple. On 64-bit
big-endian, this would result in python only writing to the upper 32
bits, and things go downhill from there.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jcristau created this revision.Aug 24 2021, 6:44 AM
marmoute accepted this revision.Aug 24 2021, 6:51 AM
marmoute added a subscriber: marmoute.

Oops.

(this should preferably go on stable.)

Oops indeed. I will take this on stable.

Alphare accepted this revision.Aug 24 2021, 8:34 AM
This revision is now accepted and ready to land.Aug 24 2021, 8:34 AM

This fails clang-format checking, I can amend if that's simpler for you.

jcristau retitled this revision from revlog: fix type confusion with sidedata_comp_len (issue 6580) to revlog: fix type confusion with sidedata_comp_len (issue6580).Aug 24 2021, 9:23 AM
jcristau updated this revision to Diff 29989.
baymax retitled this revision from revlog: fix type confusion with sidedata_comp_len (issue6580) to revlog: fix type confusion with sidedata_comp_len (issue 6580).Aug 24 2021, 9:41 AM
baymax updated this revision to Diff 29991.

✅ refresh by Heptapod after a successful CI run (🐙 💚)
⚠ This patch is intended for stable ⚠

Go home baymax, you're drunk