From: Michal Sojka Date: Mon, 26 Oct 2009 15:51:03 +0000 (+0100) Subject: Use endpoint attributes only if it has correct size X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/fwp.git/commitdiff_plain/a17d454ca6fcff12bfd62deb555ad2c43397dc1f?ds=sidebyside Use endpoint attributes only if it has correct size --- diff --git a/fwp/lib/frsh_fwp/fwp_fna.c b/fwp/lib/frsh_fwp/fwp_fna.c index 978c0ce..1c9a7e8 100644 --- a/fwp/lib/frsh_fwp/fwp_fna.c +++ b/fwp/lib/frsh_fwp/fwp_fna.c @@ -84,10 +84,15 @@ int fwp_fna_send_endpoint_created(fna_endpoint_data_t *endpoint) fwp_endpoint_attr_t *attr; fwp_endpoint_t *fwp_epoint; int rv; - + frsh_send_endpoint_protocol_info_t *spi; + node = (unsigned int) endpoint->destination; port = (unsigned int) endpoint->stream_id; - attr = (fwp_endpoint_attr_t*) endpoint->endpoint_protocol_info.send.body; + attr = NULL; + + spi = &endpoint->endpoint_protocol_info.send; + if (spi->size == sizeof(fwp_endpoint_attr_t)) + attr = (fwp_endpoint_attr_t*)spi->body; rv = fwp_send_endpoint_create(node, port, attr, &fwp_epoint); endpoint->protocol_info.body = fwp_epoint; return rv;