View | Details | Raw Unified | Return to bug 85240
Collapse All | Expand All

(-)src/pwlist.c (-5 / +24 lines)
Lines 272-284 Link Here
272
write_password_node(xmlNodePtr root, Pw* pw)
272
write_password_node(xmlNodePtr root, Pw* pw)
273
{
273
{
274
	xmlNodePtr node;
274
	xmlNodePtr node;
275
	xmlChar *escaped;
276
277
	// Take the inbound strings. Treat as an xmlChar, and escape
278
	// Need to free the result of escape every time
275
279
276
	node = xmlNewChild(root, NULL, (xmlChar*)"PwItem", NULL);
280
	node = xmlNewChild(root, NULL, (xmlChar*)"PwItem", NULL);
277
	xmlNewChild(node, NULL, (xmlChar*)"name", (xmlChar*)pw->name);
281
278
	xmlNewChild(node, NULL, (xmlChar*)"host", (xmlChar*)pw->host);
282
	escaped = xmlEncodeSpecialChars(root, (xmlChar*)pw->name);
279
	xmlNewChild(node, NULL, (xmlChar*)"user", (xmlChar*)pw->user);
283
	xmlNewChild(node, NULL, (xmlChar*)"name", escaped);
280
	xmlNewChild(node, NULL, (xmlChar*)"passwd", (xmlChar*)pw->passwd);
284
	xmlFree(escaped);
281
	xmlNewChild(node, NULL, (xmlChar*)"launch", (xmlChar*)pw->launch);
285
286
	escaped = xmlEncodeSpecialChars(root, (xmlChar*)pw->host);
287
	xmlNewChild(node, NULL, (xmlChar*)"host", escaped);
288
	xmlFree(escaped);
289
290
	escaped = xmlEncodeSpecialChars(root, (xmlChar*)pw->user);
291
	xmlNewChild(node, NULL, (xmlChar*)"user", escaped);
292
	xmlFree(escaped);
293
294
	escaped = xmlEncodeSpecialChars(root, (xmlChar*)pw->passwd);
295
	xmlNewChild(node, NULL, (xmlChar*)"passwd", escaped);
296
	xmlFree(escaped);
297
	
298
	escaped = xmlEncodeSpecialChars(root, (xmlChar*)pw->launch);
299
	xmlNewChild(node, NULL, (xmlChar*)"launch", escaped);
300
	xmlFree(escaped);
282
}
301
}
283
302
284
int
303
int

Return to bug 85240