Fixes exception when passing incorrect bytes to decode#190
Fixes exception when passing incorrect bytes to decode#190ncordon merged 3 commits intobblfsh:masterfrom
Conversation
An uncaught exception was thrown and python interpreter was killed because of that Signed-off-by: ncordon <nacho.cordon.castillo@gmail.com>
Signed-off-by: ncordon <nacho.cordon.castillo@gmail.com>
creachadair
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ncordon)
bblfsh/pyuast.cc, line 1060 at r1 (raw file):
if (!pyU) { delete(ctx); return nullptr;
In this case we haven't released buf. Should we fall through as you did in the case below?
|
bblfsh/pyuast.cc, line 1060 at r1 (raw file): Previously, creachadair (M. J. Fromberger) wrote…
I think |
creachadair
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ncordon)
bblfsh/pyuast.cc, line 1060 at r1 (raw file):
Previously, ncordon (Nacho Cordón) wrote…
I think
bufwould be released after thetry-catch, or am I missing something?
I don't see how—if we return nullptr at this point control exits the function and that code never runs, right?
|
bblfsh/pyuast.cc, line 1060 at r1 (raw file): Previously, creachadair (M. J. Fromberger) wrote…
Oh yes I missed that, my bad. Fixing it |
creachadair
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved
dennwc
left a comment
There was a problem hiding this comment.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved
That early return could provoke the buffer not being released Signed-off-by: ncordon <nacho.cordon.castillo@gmail.com>
7f039ce to
aab45d4
Compare
dennwc
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r3.
Reviewable status:complete! all files reviewed, all discussions resolved
bblfsh/pyuast.cc, line 5 at r2 (raw file):
#include <cstring> #include <unordered_map> #include <iostream>
I was also wondering why it's there, but forgot to ask :)
|
bblfsh/pyuast.cc, line 5 at r2 (raw file): Previously, dennwc (Denys Smirnov) wrote…
I erased it |
creachadair
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! all files reviewed, all discussions resolved
An uncaught exception was thrown and python interpreter was killed because of that.
Closes #189
Signed-off-by: ncordon nacho.cordon.castillo@gmail.com
This change is