Rotor plugin give Seg Fault -- need help!

Message ID 456B59E5.6010103@gmail.com
State New
Headers

Commit Message

Anssi Hannula Nov. 27, 2006, 9:34 p.m. UTC
  mlists wrote:
> Hi there, trying to set up the Rotor plugin but running into issues.
> When I fire up VDR 1.4.4 with my Twinhan 1020a card, and a diseqc rotor
> with GOTOX, I can go to the configure menu for the plugin rotor, but
> when I select rotor from the main menu, vdr immediately seg faults and
> stops.
> 
> Has anyone seen this, and if so, is there a fix to the problem?

Please try the attached patch.
  

Patch

--- rotor.c.old	2006-06-14 23:44:27.000000000 +0200
+++ rotor.c	2006-06-14 23:46:43.000000000 +0200
@@ -96,7 +96,8 @@ 
       continue;
     if ((diseqc=Diseqcs.Get(source->Code(),12000,'h')) || (diseqc=Diseqcs.Get(source->Code(),12000,'v')) || (diseqc=Diseqcs.Get(source->Code(),12000,'l')) || (diseqc=Diseqcs.Get(source->Code(),12000,'r'))) 
     {
-      char *c=strdup(diseqc->Commands());
+      char *commandstring=strdup(diseqc->Commands());
+      char *c=commandstring;      
       while (c = strchr(c, '['))
       {
         char *e = strchr(++c, ']');
@@ -131,7 +132,7 @@ 
           break;
         }
       }
-      free(c);
+      free(commandstring);
     }
     cRotorPos *p = RotorPositions.GetfromSource(source->Code());
     if (p==RotorPositions.First())