Page MenuHomePhabricator

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

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



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

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

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.