[PATCH] bug in epg.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux