RSSClient: fix possible buffer underrun
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 20 May 2012 18:13:19 +0000 (20:13 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 20 May 2012 18:13:19 +0000 (20:13 +0200)
citadel/modules/rssclient/rss_atom_parser.c

index c33fe9e707643c3f8ff9b9c78c278097db74b9da..3d0bbfb908e05c3e2e2120fd975ecc53380a5e9e 100644 (file)
@@ -745,7 +745,7 @@ void rss_save_item(rss_item *ri, rss_aggregator *RSSAggr)
                len = StrLength(ri->title);
                Sbj = html_to_ascii(ChrPtr(ri->title), len, 512, 0);
                len = strlen(Sbj);
-               if (Sbj[len - 1] == '\n')
+               if ((len > 0) && (Sbj[len - 1] == '\n'))
                {
                        len --;
                        Sbj[len] = '\0';