Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at nfs-workarounds.c:360

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

maildir_sync_is_synced

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-sync.c)expand/collapse
Show more  
 959  int maildir_sync_is_synced(struct maildir_mailbox *mbox)
 960  {
 961          bool new_changed, cur_changed;
 962          int ret;
 963   
 964          T_BEGIN {
 965                  const char *new_dir, *cur_dir;
 966   
 967                  new_dir = t_strconcat(mbox->path, "/new", NULL);
 968[+]                 cur_dir = t_strconcat(mbox->path, "/cur", NULL);
 969   
 970                  ret = maildir_sync_quick_check(mbox, FALSE, new_dir, cur_dir,
 971[+]                                                &new_changed, &cur_changed);
expand/collapse

maildir_sync_quick_check

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-sync.c)expand/collapse
Show more  
 548  static int maildir_sync_quick_check(struct maildir_mailbox *mbox, bool undirty,
 549                                      const char *new_dir, const char *cur_dir,
 550                                      bool *new_changed_r, bool *cur_changed_r)
 551  {
 552  #define DIR_DELAYED_REFRESH(hdr, name) \
 553          ((hdr)->name ## _check_time <= \
 554                  (hdr)->name ## _mtime + MAILDIR_SYNC_SECS && \
 555           (undirty || \
 556            (time_t)(hdr)->name ## _check_time < ioloop_time - MAILDIR_SYNC_SECS))
 557   
 558  #define DIR_MTIME_CHANGED(st, hdr, name) \
 559          ((st).st_mtime != (time_t)(hdr)->name ## _mtime || \
 560           !ST_NTIMES_EQUAL(ST_MTIME_NSEC(st), (hdr)->name ## _mtime_nsecs))
 561   
 562          struct maildir_index_header *hdr = &mbox->maildir_hdr;
 563          struct stat new_st, cur_st;
 564          bool refreshed = FALSE, check_new = FALSE, check_cur = FALSE;
 565   
 566          if (mbox->maildir_hdr.new_mtime == 0) {
 567                  if (maildir_sync_header_refresh(mbox) < 0)
 568                          return -1;
 569                  if (mbox->maildir_hdr.new_mtime == 0) {
 570                          /* first sync */
 571                          *new_changed_r = *cur_changed_r = TRUE;
 572                          return 0;
 573                  }
 574          }
 575   
 576          *new_changed_r = *cur_changed_r = FALSE;
 577   
 578          /* try to avoid stat()ing by first checking delayed changes */
 579          if (DIR_DELAYED_REFRESH(hdr, new) ||
 580              (DIR_DELAYED_REFRESH(hdr, cur) && !mbox->very_dirty_syncs)) {
 581                  /* refresh index and try again */
 582                  if (maildir_sync_header_refresh(mbox) < 0)
 583                          return -1;
 584                  refreshed = TRUE;
 585   
 586                  if (DIR_DELAYED_REFRESH(hdr, new))
 587                          *new_changed_r = TRUE;
 588                  if (DIR_DELAYED_REFRESH(hdr, cur) && !mbox->very_dirty_syncs)
 589                          *cur_changed_r = TRUE;
 590                  if (*new_changed_r && *cur_changed_r)
 591                          return 0;
 592          }
 593   
 594          if (!*new_changed_r) {
 595                  if (maildir_stat(mbox, new_dir, &new_st) < 0)
 596                          return -1;
 597                  check_new = TRUE;
 598          }
 599          if (!*cur_changed_r) {
 600[+]                 if (maildir_stat(mbox, cur_dir, &cur_st) < 0)
expand/collapse

maildir_stat

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-sync.c)expand/collapse
Show more  
 338  maildir_stat(struct maildir_mailbox *mbox, const char *path, struct stat *st_r)
 339  {
 340          int i;
 341   
 342          for (i = 0;; i++) {
 343[+]                 if (nfs_safe_stat(path, st_r) == 0)
expand/collapse

nfs_safe_stat

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/nfs-workarounds.c)expand/collapse
Show more  
 99  int nfs_safe_stat(const char *path, struct stat *buf)
 100  {
 101[+]         return nfs_safe_do(path, nfs_safe_stat_callback, buf);
expand/collapse

nfs_safe_do

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/nfs-workarounds.c)expand/collapse
Show more  
 47  nfs_safe_do(const char *path, int (*callback)(const char *path, void *context),
 48              void *context)
 49  {
 50          unsigned int i;
 51          int ret;
 52   
 53          for (i = 1;; i++) {
 54                  ret = callback(path, context);
 55                  if (ret == 0 || errno != ESTALE || i == NFS_ESTALE_RETRY_COUNT)
 56                          break;
 57   
 58                  /* ESTALE: Some operating systems may fail with this if they 
 59                     can't internally revalidate the NFS file handle. Flush the
 60                     file handle and try again */
 61[+]                 nfs_flush_file_handle_cache(path);
expand/collapse

nfs_flush_file_handle_cache

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/nfs-workarounds.c)expand/collapse
Show more  
 368  void nfs_flush_file_handle_cache(const char *path)
 369  {
 370[+]         nfs_flush_file_handle_cache_parent_dir(path);
expand/collapse

nfs_flush_file_handle_cache_parent_dir

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/nfs-workarounds.c)expand/collapse
Show more  
 356  static void nfs_flush_file_handle_cache_parent_dir(const char *path)
 357  {
 358          const char *p;
 359   
 360          p = strrchr(path, '/');
Show more  
Show more  
Show more  
Show more  
Show more  
Show more  
Show more  




Change Warning 7393.25828 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: