Commit edbe6c56 edbe6c56fd36741c92684b742acab5f1585f2e9b by Sergey Poznyakoff

Bugfix in libstream

* libmailutils/stream/message_stream.c (_message_open): Don't
clobber len.
1 parent 8d37416b
......@@ -180,12 +180,12 @@ _message_open (mu_stream_t stream)
if (p)
{
len = p - s;
env_from = mu_alloc (len + 1);
size_t n = p - s;
env_from = mu_alloc (n + 1);
if (!env_from)
return ENOMEM;
memcpy (env_from, s, len);
env_from[len] = 0;
memcpy (env_from, s, n);
env_from[n] = 0;
env_date = mu_strdup (p + 1);
if (!env_date)
{
......