Trying to make PRISM a more robust system, and making sure that no garbage data is sent to the plugins, corrupting the data we hold so dear, what do you think the best way of handling invalid packets?
The packet header does contain 2 main items that we should be aware of. The first being the packet size, and the second being the packet type. I think the first step should be making sure that the packet size that is reported should be equal to the packet size we have in the buffer. If these don't match the information should be discarded. The second check would come from both the packet size and the packet type. Where the packet type is fixed to a known length we should check the packet size against the packet type. For instances where the packet is of a variable length, the range of possible values should be checked.
Call for comments on this idea, and if anyone has anything to add that would be great.
The packet header does contain 2 main items that we should be aware of. The first being the packet size, and the second being the packet type. I think the first step should be making sure that the packet size that is reported should be equal to the packet size we have in the buffer. If these don't match the information should be discarded. The second check would come from both the packet size and the packet type. Where the packet type is fixed to a known length we should check the packet size against the packet type. For instances where the packet is of a variable length, the range of possible values should be checked.
Call for comments on this idea, and if anyone has anything to add that would be great.