aakash-sahai / nanopb

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

Submessage decode errors are not propagated #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt to decode a message with an invalid submessage
2. Print the error message

What is the expected output? What do you see instead?
Expected to see the error message for the submessage failure. Got null.

What version of the product are you using? On what operating system?
0.16 (but the issue appears to be present on master)

Please provide any additional information below.
Adding
  stream->errmsg = substream->errmsg;
to pb_close_string_substream sovles the problem.

Original issue reported on code.google.com by magnus.reftel on 16 Jan 2013 at 2:00

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

Original comment by Petteri.Aimonen on 16 Jan 2013 at 2:29

GoogleCodeExporter commented 9 years ago
Thanks.

Fixed now (note the two commits after the one mentioned above, adding #ifndef..)

This bug was really persistent: I was planning to add that line back when I did 
this:
https://code.google.com/p/nanopb/source/detail?r=9383f305dc42eeca8b043c5c6dff3fe
2e3e8f4f2

.. and even now it took three commits before I typed it right ,)

Original comment by Petteri.Aimonen on 16 Jan 2013 at 2:36

GoogleCodeExporter commented 9 years ago
Wow, that's quick =) Thanks!

Original comment by magnus.reftel on 16 Jan 2013 at 9:05

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

Original comment by Petteri.Aimonen on 13 Feb 2013 at 7:19