core: check validity of buffer pointer when data is sent to a buffer