From 546400fd7020d5bac1742dd19aa95c4089e22fdd Mon Sep 17 00:00:00 2001 From: msweet Date: Mon, 26 Oct 2015 18:15:48 +0000 Subject: Make sure we escape the subject and text in the RSS feed () git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12942 a1ca3aef-8c08-0410-bb20-df032aa958be --- notifier/rss.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'notifier') diff --git a/notifier/rss.c b/notifier/rss.c index ae8ae4797..3f6ca111e 100644 --- a/notifier/rss.c +++ b/notifier/rss.c @@ -3,7 +3,7 @@ * * RSS notifier for CUPS. * - * Copyright 2007-2014 by Apple Inc. + * Copyright 2007-2015 by Apple Inc. * Copyright 2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -641,15 +641,21 @@ save_rss(cups_array_t *rss, /* I - RSS messages */ msg; msg = (_cups_rss_t *)cupsArrayPrev(rss)) { + char *subject = xml_escape(msg->subject); + char *text = xml_escape(msg->text); + fputs(" \n", fp); - fprintf(fp, " %s\n", msg->subject); - fprintf(fp, " %s\n", msg->text); + fprintf(fp, " %s\n", subject); + fprintf(fp, " %s\n", text); if (msg->link_url) fprintf(fp, " %s\n", msg->link_url); fprintf(fp, " %s\n", httpGetDateString2(msg->event_time, date, sizeof(date))); fprintf(fp, " %d\n", msg->sequence_number); fputs(" \n", fp); + + free(subject); + free(text); } fputs(" \n", fp); -- cgit v1.2.1