Mercurial > public > mercurial-scm > hg-stable
diff mercurial/dirstatemap.py @ 47675:48aec076b8fb
dirstate-v2: Enforce data size read from the docket file
The data file may not be shorter than its size given by the docket.
It may be longer, but additional data is ignored.
Differential Revision: https://phab.mercurial-scm.org/D11089
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 12 Jul 2021 22:46:52 +0200 |
parents | ff97e793ed36 |
children | 065e61628980 |
line wrap: on
line diff
--- a/mercurial/dirstatemap.py Thu Jul 08 12:18:21 2021 +0200 +++ b/mercurial/dirstatemap.py Mon Jul 12 22:46:52 2021 +0200 @@ -637,7 +637,9 @@ data = self._opener.read(self.docket.data_filename()) else: data = b'' - self._rustmap = rustmod.DirstateMap.new_v2(data) + self._rustmap = rustmod.DirstateMap.new_v2( + data, self.docket.data_size + ) parents = self.docket.parents else: self._rustmap, parents = rustmod.DirstateMap.new_v1(