Show
Ignore:
Timestamp:
06/08/09 21:12:46 (3 years ago)
Author:
Neutron Soutmun <neo.neutron@…>
Children:
bae014d9f22e13f6115d53d154e6489f20ae00e4
Parents:
5987af1b79b0c1fbd4aa9d30a53ec6879853ece3
git-committer:
Neutron Soutmun <neo.neutron@…> (06/08/09 21:12:46)
Message:

Follow the flawfinder guideline

  • Reduce the vulnerability code by follow the advice of flawfinder.
  • Just finish one of the TODO lists.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/rh-task-bandwidth.c

    r2f0141c r927d0c7  
    282282   
    283283  // Formating the bandwidth request 
    284   sprintf(bw_req.ip, "%s", idtoip(vs->v_map, req->id)); 
    285   sprintf(bw_req.bandwidth_max_down, "%lu",  
    286     member->bandwidth_max_down); 
    287   sprintf(bw_req.bandwidth_max_up, "%lu",  
    288     member->bandwidth_max_up); 
     284  snprintf(bw_req.ip, sizeof (bw_req.ip), "%s", idtoip(vs->v_map, req->id)); 
     285  snprintf(bw_req.bandwidth_max_down, sizeof (bw_req.bandwidth_max_down),  
     286           "%lu", member->bandwidth_max_down); 
     287  snprintf(bw_req.bandwidth_max_up, sizeof (bw_req.bandwidth_max_up), "%lu",  
     288           member->bandwidth_max_up); 
    289289   
    290290  while (max_try > 0) {  
    291291    slot_id = _get_slot_id(); 
    292     sprintf(bw_req.slot_id, "%d", slot_id); 
     292    snprintf(bw_req.slot_id, sizeof (bw_req.slot_id), "%d", slot_id); 
    293293    if (bandwidth_add(vs, &bw_req) == 0) 
    294294      break; 
     
    328328    return 0; 
    329329 
    330   sprintf(bw_req.slot_id, "%d", slot_id); 
     330  snprintf(bw_req.slot_id, sizeof (bw_req.slot_id), "%d", slot_id); 
    331331 
    332332  if (bandwidth_del(vs, &bw_req) == 0) {