Repository : ssh://git@open-mesh.org/alfred
On branch : master
commit b5a6db7b1dda26e3cf943a9637f9f88afce5abdb Author: Simon Wunderlich siwu@hrz.tu-chemnitz.de Date: Fri May 24 16:33:01 2013 +0200
alfred: check for type and version in vis
add more checks: * version should be checked to avoid reading newer, unsupported data * type should be checked to ignore errors in alfred
Reported-by: Sven Eckelmann sven@narfation.org Signed-off-by: Simon Wunderlich siwu@hrz.tu-chemnitz.de
b5a6db7b1dda26e3cf943a9637f9f88afce5abdb vis/vis.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/vis/vis.c b/vis/vis.c index b2d43e8..c867679 100644 --- a/vis/vis.c +++ b/vis/vis.c @@ -486,6 +486,12 @@ struct vis_v1 *vis_receive_answer_packet(int sock, uint16_t *len) data = push->data; *len = ntohs(data->header.length);
+ if (data->header.type != VIS_PACKETTYPE) + return NULL; + + if (data->header.version != VIS_PACKETVERSION) + return NULL; + return (struct vis_v1 *) data->data; }