Strengthen assertion in buf.c