Changeset 143 for trunk/lib


Ignore:
Timestamp:
02/12/09 22:24:27 (16 years ago)
Author:
tim
Message:

fixed a null pointer exception

removed some dependencies on less portable items

altered Makefiles to allow for MinGW cross compiling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/regfi.c

    r140 r143  
    510510  ret_val = regfi_load_subkeylist_aux(file, offset, max_size, strict,
    511511                                      REGFI_MAX_SUBKEY_DEPTH);
     512  if(ret_val == NULL)
     513  {
     514    regfi_add_message(file, REGFI_MSG_WARN, "Failed to load subkey list at"
     515                      " offset 0x%.8X.", offset);
     516    return NULL;
     517  }
    512518
    513519  if(num_keys != ret_val->num_keys)
     
    11521158
    11531159  /* open an existing file */
    1154   if ((fd = open(filename, O_RDONLY)) == -1)
    1155   {
    1156     /* DEBUG(0,("regfi_open: failure to open %s (%s)\n", filename, strerror(errno)));*/
     1160  if ((fd = open(filename, REGFI_OPEN_FLAGS)) == -1)
     1161  {
     1162    /* fprintf(stderr, "regfi_open: failure to open %s (%s)\n", filename, strerror(errno));*/
    11571163    return NULL;
    11581164  }
     
    11701176  if ((rb = regfi_parse_regf(fd, true)) == NULL)
    11711177  {
    1172     /* DEBUG(0,("regfi_open: Failed to read initial REGF block\n"));*/
     1178    /* fprintf(stderr, "regfi_open: Failed to read initial REGF block\n"); */
    11731179    close(fd);
    11741180    return NULL;
     
    11791185  if(rb->hbins == NULL)
    11801186  {
     1187    /* fprintf(stderr, "regfi_open: Failed to create HBIN list.\n"); */
    11811188    range_list_free(rb->hbins);
    11821189    close(fd);
     
    13311338   * caching and make things slow.
    13321339   */
    1333   ret_val->sk_recs = lru_cache_create(127, 0x15DEAD05^time(NULL)
    1334                                            ^(getpid()<<16)^(getppid()<<8),
     1340  ret_val->sk_recs = lru_cache_create(127, 0x15DEAD05^time(NULL)^(getpid()<<16),
    13351341                                      true);
    13361342
Note: See TracChangeset for help on using the changeset viewer.