Changeset 5754:b23d79c13370 in roaraudio for roarclients


Ignore:
Timestamp:
11/16/12 16:49:56 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

avoid getenv() and use more portable roar_env_get(). Also improved security as we enfore const now on bufferes obtained from the env.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarmonhttp.c

    r5536 r5754  
    239239 int    i; 
    240240 const char * k, * v; 
     241 const char * qs; 
     242 char * qs_buf; 
    241243 char * c; 
    242244 char * sp0 = NULL, * sp1 = NULL; 
     
    292294 } 
    293295 
    294  c = getenv("QUERY_STRING"); 
     296 qs = roar_env_get("QUERY_STRING"); 
     297 if ( qs == NULL ) 
     298  qs = ""; 
     299 c = qs_buf = roar_mm_strdup(qs); 
    295300 if ( c == NULL ) 
    296   c = ""; 
     301  return 1; 
    297302 
    298303 c = roar_mm_strtok_r(c, "&", &sp0); 
     
    336341 } 
    337342 
     343 roar_mm_free(qs_buf); 
     344 
    338345 if ( roar_simple_connect(&con, server, "roarmonhttp") == -1 ) { 
    339346  return 10; 
Note: See TracChangeset for help on using the changeset viewer.