Merge "diag: Update mask buffer after reallocation"