Changeset 5862:560033570a60 in roaraudio


Ignore:
Timestamp:
01/11/13 13:38:43 (7 years ago)
Author:
phi
Branch:
default
Message:

avoid linker warning on openbsd, also harden against string buffer overflows by using strlcat()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroardsp/channels.c

    r5823 r5862  
    109109 } 
    110110 
    111  // TODO: FIXME: do not ignore strlen from here 
    112111 *str = 0; 
    113112 
    114113 for (i = 0; i < len; i++) { 
    115114  if ( i != 0 ) 
    116    strcat(str, ","); 
     115   roar_mm_strlcat(str, ",", strlen); 
    117116 
    118117  name = roardsp_chan2str(list[i]); 
    119118 
    120119  if ( name == NULL ) { 
    121    strcat(str, "<<<INVALID>>>"); 
     120   roar_mm_strlcat(str, "<<<INVALID>>>", strlen); 
    122121  } else { 
    123    strcat(str, name); 
     122   roar_mm_strlcat(str, name, strlen); 
    124123  } 
    125124 } 
Note: See TracChangeset for help on using the changeset viewer.