When a header has no value (*p == '\0' so l == 0), do not read outside
the buffer but print the newline anyway when a tag is already printed
(col != 0).
Caught by ASAN while opening a draft with no Subject.
/* if we have printed something but didn't \n-terminate it, do it
* except the last word we printed ended in \n already */
- if (col && buf[l - 1] != '\n')
+ if (col && (l == 0 || buf[l - 1] != '\n'))
if (putc ('\n', fp) == EOF)
return -1;