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-config.c

    r2f0141c r927d0c7  
    370370    { 
    371371      iface = (struct interfaces *)runner->data; 
    372       if (strncmp(iface->dev_internal, inf_name, strlen(inf_name)) == 0) 
     372      if (iface->dev_internal && 
     373          strncmp(iface->dev_internal, inf_name, strlen(inf_name)) == 0) 
    373374        { 
    374375          // Already in the list 
     
    388389    } 
    389390 
    390   strncpy(item->dev_internal, inf_name, 32); 
    391   sprintf(item->dev_ifb, "ifb%d", ifb_ifno); 
     391  strncpy(item->dev_internal, inf_name, sizeof (item->dev_internal)); 
     392  snprintf(item->dev_ifb, sizeof (item->dev_ifb), "ifb%d", ifb_ifno); 
    392393  item->init = 0; 
    393394  item->hit  = 1; 
     
    411412    { 
    412413      iface = (struct interfaces *)runner->data; 
    413       if (strncmp (iface->dev_internal, inf_name, strlen (inf_name)) == 0) 
     414      if (iface->dev_internal && 
     415          strncmp (iface->dev_internal, inf_name, strlen (inf_name)) == 0) 
    414416        { 
    415417          iface->hit--;