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) ...@@ -180,12 +180,12 @@ _message_open (mu_stream_t stream)
180 180
181 if (p) 181 if (p)
182 { 182 {
183 len = p - s; 183 size_t n = p - s;
184 env_from = mu_alloc (len + 1); 184 env_from = mu_alloc (n + 1);
185 if (!env_from) 185 if (!env_from)
186 return ENOMEM; 186 return ENOMEM;
187 memcpy (env_from, s, len); 187 memcpy (env_from, s, n);
188 env_from[len] = 0; 188 env_from[n] = 0;
189 env_date = mu_strdup (p + 1); 189 env_date = mu_strdup (p + 1);
190 if (!env_date) 190 if (!env_date)
191 { 191 {
......