From 068de05c51b7b46e33ef87b8d78c9dda6704abc8 Mon Sep 17 00:00:00 2001 From: Jens Steinhauser Date: Tue, 27 Nov 2012 00:19:55 +0100 Subject: Complete initialization of pb_istream_t. Because PB_RETURN_ERROR checks if the 'errmsg' member is NULL before assigning to it, error messages would get lost. --- pb_decode.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pb_decode.c') diff --git a/pb_decode.c b/pb_decode.c index 8e01fd7a..c9652afb 100644 --- a/pb_decode.c +++ b/pb_decode.c @@ -80,6 +80,9 @@ pb_istream_t pb_istream_from_buffer(uint8_t *buf, size_t bufsize) stream.callback = &buf_read; stream.state = buf; stream.bytes_left = bufsize; +#ifndef PB_NO_ERRMSG + stream.errmsg = NULL; +#endif return stream; } -- cgit 1.2.3-korg