Fix possible coredump in stream library.
* libmailutils/stream/stream.c (mu_stream_strerror): stream can be NULL.
Showing
1 changed file
with
2 additions
and
0 deletions
... | @@ -371,6 +371,8 @@ mu_stream_strerror (mu_stream_t stream, int rc) | ... | @@ -371,6 +371,8 @@ mu_stream_strerror (mu_stream_t stream, int rc) |
371 | { | 371 | { |
372 | const char *str; | 372 | const char *str; |
373 | 373 | ||
374 | if (!stream) | ||
375 | return mu_strerror (rc); | ||
374 | if (stream->error_string) | 376 | if (stream->error_string) |
375 | str = stream->error_string (stream, rc); | 377 | str = stream->error_string (stream, rc); |
376 | else | 378 | else | ... | ... |
-
Please register or sign in to post a comment