[vdr] [PATCH] bug in epg.c

Wolfgang Rohdewald wolfgang at rohdewald.de
Fri Feb 18 11:12:22 CET 2005


this patch removes unneeded code and inhibits access to unallocated memory:
(the latter found by valgrind)


--- /tmp/epg.c  2005-02-18 10:44:55.000762224 +0100
+++ epg.c       2005-02-18 10:45:56.379431248 +0100
@@ -525,7 +525,7 @@
      if (description) {
         char *p = description;
         while (*p && *(p + 1) && *(p + 2)) {
-              if (*p == '-' && *(p + 1) == ' ' && *(p + 2) && islower(*(p - 1)) && islower(*(p + 2))) {
+              if (*p == '-' && *(p + 1) == ' ' && p != description && islower(*(p - 1)) && islower(*(p + 2))) {
                  if (!startswith(p + 2, "und ")) { // special case in German, as in "Lach- und Sachgeschichten"
                     memmove(p, p + 2, strlen(p + 2) + 1);
                     EpgBugFixStat(5, ChannelID());

-- 
Wolfgang




More information about the vdr mailing list