#242 Segv in upnpsoap.c line 353

v1.0 (example)
closed-duplicate
None
5
2014-07-05
2014-05-31
Eamon
No

Hi.
minidlna 1.1.2 file: upnpsoap.c line 353

if( !filter || (strlen(filter) <= 1) ) {
  if (strcmp(filter, "*") == 0 && samsung) {
    return 0xFFFFFFFF;  /* We want FILTER_SEC_DCM_INFO */
    } else {

Unfotunatly, having verified that filter is NULL it goes to use in on line 354 causeing a segv.

I don't understand the code well enough to make a proper fix, but the below diff will at least stop the segv and allows the code to work for me.

Eamon.

   diff -c minidlna-1.1.2/upnpsoap.c minidlna-1.1.2.eh/upnpsoap.c
   *** minidlna-1.1.2/upnpsoap.c   2014-05-31 12:04:04.000000000 -0500
   --- minidlna-1.1.2.eh/upnpsoap.c        2014-05-31 12:05:04.000000000 -0500
   ***************
   *** 350,363 ****
           uint32_t flags = 0;
           int samsung = client_types[h->req_client].flags & FLAG_SAMSUNG;

   !       if( !filter || (strlen(filter) <= 1) ) {
                   if (strcmp(filter, "*") == 0 && samsung) {
                           return 0xFFFFFFFF;  /* We want FILTER_SEC_DCM_INFO */
   !               } else {
   !                       /* Not the full 32 bits.  Skip vendor-specific stuff by default. */
   !                       return 0xFFFFFF;
                   }
   !       }

           if( samsung )
                   flags |= FILTER_DLNA_NAMESPACE;
   --- 350,367 ----
           uint32_t flags = 0;
           int samsung = client_types[h->req_client].flags & FLAG_SAMSUNG;

   !   if( !filter || (strlen(filter) <= 1) )
   !               /* Not the full 32 bits.  Skip vendor-specific stuff by default. */
   !               return 0xFFFFFF;
   !
   ! //    if( !filter || (strlen(filter) <= 1) ) {
                   if (strcmp(filter, "*") == 0 && samsung) {
                           return 0xFFFFFFFF;  /* We want FILTER_SEC_DCM_INFO */
   ! //            } else {
   ! //                    /* Not the full 32 bits.  Skip vendor-specific stuff by default. */
   ! //                    return 0xFFFFFF;
                   }
   ! //    }

           if( samsung )
                   flags |= FILTER_DLNA_NAMESPACE;

Discussion

  • Eamon
    Eamon
    2014-06-01

    Hi.

    It's a duplicate of 234.

    Eamon.

     
  • Justin Maggard
    Justin Maggard
    2014-06-05

    • status: open --> closed-duplicate