[vdr] get a segmentation fault when starting vdr (backtrace included)

Dr. Werner Fink werner at suse.de
Fri Nov 30 11:23:51 CET 2012


On Fri, Nov 30, 2012 at 11:00:52AM +0100, Dieter Bloms wrote:
> 
> I changed it this way:
> 
> --snip--
>   32 bool tComponent::FromString(const char *s)
>   33 {
>   34   unsigned int Stream, Type;
>   35   description = NULL;
>   36   int n = sscanf(s, "%X %02X %7s %a[^\n]", &Stream, &Type, language, &description); // 7 = MAXLANGCODE2 - 1
>   37   esyslog("dbloms: \"%X\" \"%02X\" \"%7s\" \"%a\"", Stream, Type, language, description);
>   38 
>   39   if (n != 4 || isempty(description)) {
>   40      free(description);
>   41      description = NULL;
>   42      }
>   43   stream = Stream;
>   44   type = Type;
>   45   return n >= 3;
>   46 }
> --snip--

IMHO the %a should become %s in esyslog() whereas in sscanf() the %a should become %as
for the GNU extension of dynamically allocating string conversions.

     Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr



More information about the vdr mailing list