fix allocated buffer mutability after previous commit