summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmailutils/stream/stream.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libmailutils/stream/stream.c b/libmailutils/stream/stream.c
index 45efe3b4e..7b6a3c72f 100644
--- a/libmailutils/stream/stream.c
+++ b/libmailutils/stream/stream.c
@@ -1238,10 +1238,13 @@ mu_stream_set_stat (mu_stream_t stream, int statmask,
{
if (stream == NULL)
return EINVAL;
+ if (!statbuf)
+ statmask = 0;
stream->statmask = statmask;
stream->statbuf = statbuf;
- memset (stream->statbuf, 0,
- _MU_STREAM_STAT_MAX * sizeof (stream->statbuf[0]));
+ if (stream->statbuf)
+ memset (stream->statbuf, 0,
+ _MU_STREAM_STAT_MAX * sizeof (stream->statbuf[0]));
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.