[Reviewer: Mike][From: Alex] Fix crash when building SAS messages

Mike, please could you review this fix. It addresses a crash Ellie hit in std::string::reserve which I think is caused by params_buf_len returning random memory, which causes `new` to allocate loads of memory and crash.

I've also tightened up the compiler options.