nagalun / multiplayerpiano-server

Unofficial server for the http://multiplayerpiano.com client.
https://piano.ourworldofpixels.com
ISC License
12 stars 16 forks source link

Empty sendArray causes server crash. #30

Closed ar065 closed 3 years ago

ar065 commented 3 years ago
MPP.client.sendArray([""]);

Sending this can easily crash the server.

ghost commented 3 years ago

that's not empty but an array with an empty string. what about other strings, or other types like numbers, booleans and null? normally the array only ever has objects so perhaps the server doesn't expect other data types.

nagalun commented 3 years ago

https://github.com/nagalun/multiplayerpiano-server/blob/02c2e9916ee5251ec80ba8d8486b255d8f5710c0/src/server.cpp#L534 needs m.is_object() check and a try catch around it to ignore future slip-ups like these

ghost commented 3 years ago

fixed?

ar065 commented 3 years ago

fixed?

Appears to be (In your server at least)

nagalun commented 3 years ago

On this one too, now.