Avoid allocating a buffer
tmp: dump the buffer on failure