4xm: validate the buffer size before parsing it