diff options
author | jcorgan | 2007-03-11 16:32:34 +0000 |
---|---|---|
committer | jcorgan | 2007-03-11 16:32:34 +0000 |
commit | 1cdeff14aa038f53336f871f588e6b6a2d67a82d (patch) | |
tree | 30f2920a47523f3beebe7f0ca775649b72b0be70 /gnuradio-core/src/lib/general | |
parent | 597e6db00739dd479ebcf9fe22c3a5ea9465e405 (diff) | |
download | gnuradio-1cdeff14aa038f53336f871f588e6b6a2d67a82d.tar.gz gnuradio-1cdeff14aa038f53336f871f588e6b6a2d67a82d.tar.bz2 gnuradio-1cdeff14aa038f53336f871f588e6b6a2d67a82d.zip |
Fixed state machine hangup with invalid payload_len field.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@4737 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/lib/general')
-rw-r--r-- | gnuradio-core/src/lib/general/gr_framer_sink_1.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/general/gr_framer_sink_1.cc b/gnuradio-core/src/lib/general/gr_framer_sink_1.cc index 1d939adbd..be5209a71 100644 --- a/gnuradio-core/src/lib/general/gr_framer_sink_1.cc +++ b/gnuradio-core/src/lib/general/gr_framer_sink_1.cc @@ -57,6 +57,11 @@ gr_framer_sink_1::enter_have_header(int payload_len, int whitener_offset) if (VERBOSE) fprintf(stderr, "@ enter_have_header (payload_len = %d) (offset = %d)\n", payload_len, whitener_offset); + if (payload_len < 4) { // should be at least the length of the CRC field + enter_search(); + return; + } + d_state = STATE_HAVE_HEADER; d_packetlen = payload_len; d_packet_whitener_offset = whitener_offset; |