Text   |  XML   |  ReML   |   Visible Warnings:

File System Race Condition  at disabled_protos.c:376

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

save_disabled_protos_list

(/home/sate/Testcases/c/cve/wireshark-1.2.0/disabled_protos.c)expand/collapse
Show more  
 331  save_disabled_protos_list(char **pref_path_return, int *errno_return)
 332  {
 333    gchar       *ff_path, *ff_path_new;
 334    FILE        *ff;
 335    gint         i;
 336    protocol_t  *protocol;
 337    void        *cookie;
 338   
 339    *pref_path_return = NULL;     /* assume no error */
 340   
 341    ff_path = get_persconffile_path(PROTOCOLS_FILE_NAME, TRUE, TRUE);
 342   
 343    /* Write to "XXX.new", and rename if that succeeds.
 344       That means we don't trash the file if we fail to write it out
 345       completely. */
 346    ff_path_new = g_strdup_printf("%s.new", ff_path);
 347   
 348    if ((ff = ws_fopen(ff_path_new, "w")) == NULL) {
 349      *pref_path_return = ff_path;
 350      *errno_return = errno;
 351      g_free(ff_path_new);
 352      return;
 353    }
 354   
 355    /* Iterate over all the protocols */
 356   
 357[+]   for (i = proto_get_first_protocol(&cookie); i != -1;
 358         i = proto_get_next_protocol(&cookie)) {
 359   
 360      if (!proto_can_toggle_protocol(i)) {
 361        continue;
 362      }
 363   
 364      protocol = find_protocol_by_id(i);
 365      if (proto_is_protocol_enabled(protocol)) {
 366        continue;
 367      }
 368   
 369      /* Write out the protocol name. */
 370      fprintf(ff, "%s\n", proto_get_protocol_filter_name(i));
 371    }
 372   
 373    if (fclose(ff) == EOF) {
 374      *pref_path_return = ff_path;
 375      *errno_return = errno;
 376      ws_unlink(ff_path_new);
Show more  




Change Warning 4247.30615 : File System Race Condition

Because they are very similar, this warning shares annotations with warning 4247.30617.

Priority:
State:
Finding:
Owner:
Note: