Added a much-needed bounds check to message buffers. Pretty bad this was forgotten and not done earlier.