]> Sergey Matveev's repositories - public-inbox.git/commit
Import: Don't copy nulls from emails into git
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 7 Jul 2018 18:22:28 +0000 (13:22 -0500)
committerEric Wong <e@80x24.org>
Sat, 7 Jul 2018 23:02:13 +0000 (23:02 +0000)
commitaca47e05a6026c12c768753c87e6ff769ef6bee4
tree5c84328b44e68f9a405f8c3437556177368b7cbc
parentae80a3fdb53d70142624f2691ed8ed84eddda66b
Import: Don't copy nulls from emails into git

Recently I ran git --git-dir=lkml/git/1.git fsck
and it reported:
> warning in commit 299dbd50b6995c6debe2275f0df984ce697fb4cc: nulInCommit: NULL byte inthe commit object body

Which I found quite scary.  Nulls in the wrong place have a bad tendency
to make programs misbehave.

It turns out someone had placed "=?iso-8859-1?q?=00?=" at the end of
their subject line.  Which is the mime encoding for NULL.  Email::Mime
had correctly decoded the header, and then public-inbox had simply
copied the contents of the header into the subject line of the git
commit.

To prevent that from causing problems replace nulls in such subject
lines with spaces.

Signed-off-by: Eric Biederman <ebiederm@xmission.com>
MANIFEST
lib/PublicInbox/Import.pm
t/nulsubject.t [new file with mode: 0644]