[Libpst-devel] rfc2426_escape

Nigel Horne njh at bandsman.co.uk
Wed May 10 10:32:17 UTC 2006


It strikes me that rfc2426_escape is completely broken because of its
realiance on a single buffer.

Look around lines 477 of readpst.c and consider what happens in this code
if more than one string needs escaping. Since the same pointer will be
passed to fprintf which by definition means you won't get the output you
expect.

fprintf(f->output, "N:%s;%s;%s;%s;%s\n",
	rfc2426_escape((item->contact->surname==NULL?"":item->contact->surname)),
	rfc2426_escape((item->contact->first_name==NULL?"":item->contact->first_name)),
	rfc2426_escape((item->contact->middle_name==NULL?"":item->contact->middle_name)),
	rfc2426_escape((item->contact->display_name_prefix==NULL?"":item->contact->display_name_prefix)),

-Nigel



More information about the Libpst-devel mailing list