First of all I'd like to thank you on sharing this library, really useful stuff.
I've used it for over a year and never had any issues with it or needed to do any debugging. But recently it started crashing my arduino sketches every time I tried to create a new websocket.
After some debugging, i traced the problem to the temp[60] buffer used for the handshake. The headers are read to this buffer with no length checking, and that's what was causing the crashes, since the headers are much bigger that 60 chars. In Chrome the biggest header i get is 121 bytes:
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36
Currently the library only works for me in Firefox (even if the header in firefox is also bigger than 60 bytes).
Then I changed the 60 to 128 and now it works again in Chrome, Firefox and IE.
I never really has to look at these headers before today, but I guess they used to be smaller but now they added some more data which made it overflow and crash. It's a simple for anyone having the same issue.
First of all I'd like to thank you on sharing this library, really useful stuff. I've used it for over a year and never had any issues with it or needed to do any debugging. But recently it started crashing my arduino sketches every time I tried to create a new websocket. After some debugging, i traced the problem to the temp[60] buffer used for the handshake. The headers are read to this buffer with no length checking, and that's what was causing the crashes, since the headers are much bigger that 60 chars. In Chrome the biggest header i get is 121 bytes: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36 Currently the library only works for me in Firefox (even if the header in firefox is also bigger than 60 bytes). Then I changed the 60 to 128 and now it works again in Chrome, Firefox and IE. I never really has to look at these headers before today, but I guess they used to be smaller but now they added some more data which made it overflow and crash. It's a simple for anyone having the same issue.