Changed from a const pointer to a regular pointer in the buffer, because we cannot handle a const pointer in this way without -fpermissive.