From c96dea7fa0f70e29ea41215cec05131117ae3466 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Thu, 9 Jul 2015 12:23:52 -0700 Subject: [PATCH] preamble: Check to see if PMT key is actually a symbol before converting to string. --- lib/preamble_impl.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/preamble_impl.cc b/lib/preamble_impl.cc index 026fe2d..7fd8143 100644 --- a/lib/preamble_impl.cc +++ b/lib/preamble_impl.cc @@ -98,7 +98,9 @@ static double correlate_preamble(const float *in, int samples_per_chip) { } static pmt::pmt_t tag_to_timestamp(gr::tag_t tstamp, uint64_t abs_sample_cnt, int rate) { - if(tstamp.key == NULL || pmt::symbol_to_string(tstamp.key) != "rx_time") return 0; + if(tstamp.key == NULL) return 0; + if(!pmt::is_symbol(tstamp.key)) return 0; + if(pmt::symbol_to_string(tstamp.key) != "rx_time") return 0; //the timestamp tag has tstamp.offset, the sample index of the timestamp tag //also tstamp.value, a pmt pair with (uint64, double) representing int and