(stream_sequential_readline, stream_strerror): Check for stream == NULL.
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -686,6 +686,8 @@ stream_sequential_readline (stream_t stream, char *buf, size_t size, | ... | @@ -686,6 +686,8 @@ stream_sequential_readline (stream_t stream, char *buf, size_t size, |
686 | int | 686 | int |
687 | stream_sequential_write (stream_t stream, char *buf, size_t size) | 687 | stream_sequential_write (stream_t stream, char *buf, size_t size) |
688 | { | 688 | { |
689 | if (stream == NULL) | ||
690 | return EINVAL; | ||
689 | while (size > 0) | 691 | while (size > 0) |
690 | { | 692 | { |
691 | size_t sz; | 693 | size_t sz; |
... | @@ -703,6 +705,8 @@ stream_sequential_write (stream_t stream, char *buf, size_t size) | ... | @@ -703,6 +705,8 @@ stream_sequential_write (stream_t stream, char *buf, size_t size) |
703 | int | 705 | int |
704 | stream_strerror (stream_t stream, const char **p) | 706 | stream_strerror (stream_t stream, const char **p) |
705 | { | 707 | { |
708 | if (stream == NULL) | ||
709 | return EINVAL; | ||
706 | if (stream->_strerror) | 710 | if (stream->_strerror) |
707 | return stream->_strerror (stream, p); | 711 | return stream->_strerror (stream, p); |
708 | return ENOSYS; | 712 | return ENOSYS; | ... | ... |
-
Please register or sign in to post a comment