gopcua / opcua

Native Go OPC-UA library
MIT License
856 stars 259 forks source link

Fixed panic if h.MessageSize < hdrlen bytes. #692

Closed SailorStu closed 11 months ago

SailorStu commented 11 months ago

This fix resolves a Panic seen in Receive() where if a MessageSize in Packet was less than expected 8 bytes, then a panic would result from an out of bounds slice. Fix is to check MessageSize against hdrlen(8) bytes and if smaller, return in error. https://github.com/SailorStu/Pcaps/blob/main/gopcua/opcua-crash.pcap