One thing I forgot to mention is that the C function I am calling is part of a C library that was written by others. I do have some ability to request changes in the interface, however. If I were to use inline C Code is there any way to link that in with the rest of my C library? I realize that buffer overflow could be a problem, however I'm not sure what can be done about it from the Perl code. I tried passing a pointer to a pointer to the C code as suggested, but had problem getting the .xs file to accept that. I think the easiest way to handle the problem is to make sure to check the length of the error string before copying it into the buffer.