Currently, if you pass an output buffer size of 0 to parse_name() it will
cause an overflow when checking the output buffer space. This change causes the
function to short-circuit and fail when passed a buffer size of 0 instead.
Also adds a test for this scenario.
Depends on D4418