summaryrefslogtreecommitdiff
path: root/cesar/bsu/beacon
diff options
context:
space:
mode:
authorNélio Laranjeiro2011-11-04 12:07:24 +0100
committerNélio Laranjeiro2011-11-04 12:07:24 +0100
commit68fffafea5fc91b80adc967f94f7c227aea4b795 (patch)
tree03cf09c9c9279b68e94550ffaaea3e5a4926b727 /cesar/bsu/beacon
parent4f912f4c2f15bc4e4b2eb2f6f64fa587794ea031 (diff)
cesar/interface/sniffer: bad addr was given to the lib function, closes #2824
bsu_beacon_write_bitstream_initialised_no_nid need the pointer to the beginning of the bitstream.
Diffstat (limited to 'cesar/bsu/beacon')
-rw-r--r--cesar/bsu/beacon/src/beacon.c3
-rw-r--r--cesar/bsu/beacon/test/utest/src/beacon.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/cesar/bsu/beacon/src/beacon.c b/cesar/bsu/beacon/src/beacon.c
index 67ebf18342..57ffcc9966 100644
--- a/cesar/bsu/beacon/src/beacon.c
+++ b/cesar/bsu/beacon/src/beacon.c
@@ -922,7 +922,8 @@ bsu_beacon_read (pb_beacon_t *pbbeacon, bsu_beacon_t *beacon)
for (nbe = 0; ok && nbe < beacon->bmis.nbe; nbe++)
{
ok = bsu_beacon_read_bmi_header (&stream, &header, &length)
- && header >= header_prev;
+ && header >= header_prev
+ && length;
if (ok)
{
switch (header)
diff --git a/cesar/bsu/beacon/test/utest/src/beacon.c b/cesar/bsu/beacon/test/utest/src/beacon.c
index 35c36c39ff..ebf5bd0e09 100644
--- a/cesar/bsu/beacon/test/utest/src/beacon.c
+++ b/cesar/bsu/beacon/test/utest/src/beacon.c
@@ -260,9 +260,9 @@ test_case_beacon_bmi_vendor_bentry (test_t test)
/* Add a vendor specific bentry after all the other ones */
bitstream_direct_write (phy_beacon->data, 8*90 + 72,
BSU_BEACON_ENTRY_HEADER_VENDOR, 8);
- /* Set a null size for the vendor bentry */
+ /* Set a non null size for the vendor bentry */
bitstream_direct_write (phy_beacon->data, 8*90 + 80,
- 0, 8);
+ 5, 8);
memset (&beacon, 0, sizeof (bsu_beacon_t));
returned = bsu_beacon_read (phy_beacon, &beacon);
test_fail_unless (returned == true);