aboutsummaryrefslogtreecommitdiff
path: root/tests/regression/issue_647/repro.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regression/issue_647/repro.c')
-rw-r--r--tests/regression/issue_647/repro.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/regression/issue_647/repro.c b/tests/regression/issue_647/repro.c
new file mode 100644
index 0000000..48d9570
--- /dev/null
+++ b/tests/regression/issue_647/repro.c
@@ -0,0 +1,16 @@
+#include <pb_decode.h>
+#include <unittests.h>
+#include <malloc_wrappers.h>
+#include "repro.pb.h"
+
+int main() {
+ const uint8_t data[] = {0x08, 0x08, 0x2d};
+ int status = 0;
+ Repro repro = Repro_init_zero;
+
+ pb_istream_t stream = pb_istream_from_buffer(data, sizeof(data));
+ TEST(!pb_decode(&stream, Repro_fields, &repro));
+ TEST(get_alloc_count() == 0);
+
+ return status;
+}