Changeset 5145:c1a3ca765154 in roaraudio for libroar/client.c


Ignore:
Timestamp:
10/11/11 13:47:59 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:
  • Fixed invalid pointer aliasing in filter code (pr0)
  • Fixed remote a local buffer overflow in client to message converter code as well as a remote attackable overflow in message to client converter code (pr0)
  • Updated error handling (pr0)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/client.c

    r4948 r5145  
    3939 int i; 
    4040 
    41  if ( client == NULL ) 
     41 if ( client == NULL ) { 
     42  roar_err_set(ROAR_ERROR_FAULT); 
    4243  return -1; 
     44 } 
    4345 
    4446 memset(client, 0, sizeof(struct roar_client)); 
     
    5860 
    5961int roar_client_set_fh   (struct roar_client * client, int fh) { 
    60  if ( client == NULL ) 
     62 if ( client == NULL ) { 
     63  roar_err_set(ROAR_ERROR_FAULT); 
    6164  return -1; 
     65 } 
    6266 
    6367 client->fh = fh; 
     
    6771 
    6872int roar_client_set_proto(struct roar_client * client, int proto, int byteorder) { 
    69  if ( client == NULL ) 
     73 if ( client == NULL ) { 
     74  roar_err_set(ROAR_ERROR_FAULT); 
    7075  return -1; 
     76 } 
    7177 
    7278 client->proto = proto; 
     
    8086    break; 
    8187   default: 
     88     roar_err_set(ROAR_ERROR_INVAL); 
    8289     return -1; 
    8390    break; 
     
    93100 int confh; 
    94101 int i; 
     102 
     103 if ( con == NULL || client == NULL ) { 
     104  roar_err_set(ROAR_ERROR_FAULT); 
     105  return -1; 
     106 } 
    95107 
    96108 memset(&m,  0, sizeof(m)); 
     
    133145 int i; 
    134146 
     147 if ( con == NULL || client == NULL ) { 
     148  roar_err_set(ROAR_ERROR_FAULT); 
     149  return -1; 
     150 } 
     151 
    135152 memset(&m,  0, sizeof(m)); 
    136153 
Note: See TracChangeset for help on using the changeset viewer.