Ignore:
Timestamp:
04/29/08 13:53:22 (5 years ago)
Author:
thomas
Message:

opkg: prevent segfault if option is not found

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/opkg/libopkg/opkg.c

    r4398 r4407  
    296296opkg_set_option (opkg_t *opkg, char *option, void *value) 
    297297{ 
    298   int i = 0; 
     298  int i = 0, found = 0; 
    299299  opkg_option_t *options; 
    300300 
     
    312312    if (strcmp (options[i].name, option) == 0) 
    313313    { 
     314      found = 1; 
    314315      break; 
    315316    } 
    316317    i++; 
     318  } 
     319 
     320  if (!found) 
     321  { 
     322    /* XXX: Warning: Option not found */ 
     323    return; 
    317324  } 
    318325 
Note: See TracChangeset for help on using the changeset viewer.