Re: [PATCH 1/4] mailinfo: treat header values as C strings
On Tue, Feb 11, 2020 at 12:18 PM Jeff King <peff@peff.net> wrote:
Show 5 quoted lines
> We read each header line into a strbuf, which means that we could
> in theory handle header values with embedded NUL bytes. But in practice,
> the values we parse out are passed to decode_header(), which uses
> strstr(), strchr(), etc. And we would not expect such bytes anyway; they
> are forbidden by RFC822, etc and any non-ASCII characters should be
Show 6 quoted lines
> encoded with RFC2047 encoding.
>
> So let's switch to using strbuf_addstr(), which saves us some length
> computations (and will enable further cleanups in this code).
>
> Signed-off-by: Jeff King <peff@peff.net>