dirstate: fix parse_dirstate() to error out if NULL entry created
Since
83f0e93ec34b "dirstate-item: move the C implementation to the same
logic", dirstate_item_from_v1_data() gets more likely to return NULL, and
the fuzzer crashes because of that.
--- a/mercurial/cext/parsers.c Mon Sep 20 20:55:38 2021 +0200
+++ b/mercurial/cext/parsers.c Thu Sep 23 16:44:17 2021 +0900
@@ -770,6 +770,8 @@
entry = (PyObject *)dirstate_item_from_v1_data(state, mode,
size, mtime);
+ if (!entry)
+ goto quit;
cpos = memchr(cur, 0, flen);
if (cpos) {
fname = PyBytes_FromStringAndSize(cur, cpos - cur);