Merge pull request #1149 from tom-daubney-arm/mac_buffer_protection

Implement safe buffer copying in MAC API