summaryrefslogtreecommitdiff
path: root/cesar/hal/ipmbox/maximus
diff options
context:
space:
mode:
authorCeline Buret2012-02-21 14:47:00 +0100
committerCeline Buret2012-02-21 18:01:20 +0100
commit9da14b6ae6f70a1935540dd93d5a4cd8b621c135 (patch)
tree722737e883b3ee29ee82fbdfe13a83c8c093e1cd /cesar/hal/ipmbox/maximus
parent67a283f76d41cab91aefff3151962113510600f3 (diff)
cesar/hal/ipmbox/maximus/test: fix invalid read, refs #2987
Diffstat (limited to 'cesar/hal/ipmbox/maximus')
-rw-r--r--cesar/hal/ipmbox/maximus/test/src/test_maximus_ipmbox.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cesar/hal/ipmbox/maximus/test/src/test_maximus_ipmbox.c b/cesar/hal/ipmbox/maximus/test/src/test_maximus_ipmbox.c
index 28a266d2a4..88db6e3780 100644
--- a/cesar/hal/ipmbox/maximus/test/src/test_maximus_ipmbox.c
+++ b/cesar/hal/ipmbox/maximus/test/src/test_maximus_ipmbox.c
@@ -240,12 +240,13 @@ ipmbox_tx_data_test_case (test_t t)
/* Mailbox msg. */
ipmbox_msg_data_t msg_data;
+ u32 buf_id = 32;
int i;
maximus_ipmbox_buffer_t *second_buffer = (maximus_ipmbox_buffer_t *) \
calloc (1, sizeof (maximus_ipmbox_buffer_t));
second_buffer->next = NULL;
- second_buffer->id = 32;
+ second_buffer->id = buf_id;
second_buffer->data = (u32 *) calloc (frame_length, sizeof (u8));
for (i = 0; i < frame_length; i++)
{
@@ -266,7 +267,7 @@ ipmbox_tx_data_test_case (test_t t)
/* Check results. */
test_ether_msg (t, frame, frame_length, ETHERNET_TYPE_DATA);
- test_buffer_released (t, second_buffer->id);
+ test_buffer_released (t, buf_id);
}
void
@@ -281,12 +282,13 @@ ipmbox_tx_mbx_test_case (test_t t)
/* Mailbox msg. */
ipmbox_msg_mbx_t msg_mbx;
+ u32 buf_id = 32;
int i;
maximus_ipmbox_buffer_t *second_buffer = (maximus_ipmbox_buffer_t *) \
calloc (1, sizeof (maximus_ipmbox_buffer_t));
second_buffer->next = NULL;
- second_buffer->id = 32;
+ second_buffer->id = buf_id;
second_buffer->data = (u32 *) calloc (frame_length, sizeof (u8));
for (i = 0; i < frame_length; i++)
{
@@ -307,7 +309,7 @@ ipmbox_tx_mbx_test_case (test_t t)
/* Check results. */
test_ether_msg (t, frame, frame_length, ETHERNET_TYPE_MME);
- test_buffer_released (t, second_buffer->id);
+ test_buffer_released (t, buf_id);
}
void