This is an archive of the discontinued Mercurial Phabricator instance.

tags: add safety check for len(record) while reading hgtagsfnodescache
ClosedPublic

Authored by pulkit on Oct 7 2020, 5:48 AM.

Details

Summary

I am trying to fix a breakage where somehow we end up getting a node of 12
length from getfnode(). Understanding the hgtagsfnodescache code, it seems
highly unlikely that it can happen unless one of mctx.readfast().get() or
ctx.filenode() is returning a node of 12 length.

For safety, I think it's better to add a check to make sure that record which we
are parsing is of same length we are expecting otherwise we consider that as
invalid record.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

pulkit created this revision.Oct 7 2020, 5:48 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.