global.c: canonicalization input and output buffers may overlap