Fix a potential uninitialized use of buf caught by clang