[darcs-devel] [issue2576] PatchInfo parsing is broken / needs validation

Ben Franksen bugs at darcs.net
Sun Mar 18 20:59:22 UTC 2018


Ben Franksen <ben.franksen at online.de> added the comment:

Here is a summary of what the PatchInfo items may contain in order for
readPatchInfo to be able to parse back what showPatchinfo writes to disk.

date: any ASCII(!) character except '\n' or ']'
name,log: anything but '\n'
author: anything but '*'

The ASCII restriction for date is due to the use of BC.pack/unpack. The
other restrictions are necessary because the parser uses these
characters as delimiters of the fields in question. For the log the
restriction applies to each line of the log, of course.

Violating any of these invariants when constructing a PatchInfo can lead
to unparsable PatchInfos written to disk which is absolutely fatal for
users.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2576>
__________________________________


More information about the darcs-devel mailing list