iamandi / nanopb

Automatically exported from code.google.com/p/nanopb
zlib License
0 stars 0 forks source link

Encoder should sanity-check the array count #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Generate a message with max_count set for an array.
2. Assign a ridiculously large value to the mymsg.fooarray_count.
3. Nanopb goes happily reading past the structure.

What is the expected output? What do you see instead?

This is kind of an user error, "garbage in, garbage out". But it would be 
trivially simple to detect, and return an error message instead.

Original issue reported on code.google.com by Petteri.Aimonen on 27 Sep 2013 at 9:23

GoogleCodeExporter commented 9 years ago
This issue was updated by revision e83fbd18d3fa.

Original comment by Petteri.Aimonen on 20 Oct 2013 at 7:50

GoogleCodeExporter commented 9 years ago
Fix released in nanopb-0.2.4.

Original comment by Petteri.Aimonen on 7 Nov 2013 at 2:56