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

dotlock_create

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/file-dotlock.c)expand/collapse
Show more  
 458  dotlock_create(struct dotlock *dotlock, enum dotlock_create_flags flags,
 459                 bool write_pid, const char **lock_path_r)
 460  {
 461          const struct dotlock_settings *set = &dotlock->settings;
 462          const char *lock_path;
 463          struct lock_info lock_info;
 464          struct stat st;
 465          unsigned int stale_notify_threshold;
 466          unsigned int change_secs, wait_left;
 467          time_t now, max_wait_time, last_notify;
 468          time_t prev_last_change = 0, prev_wait_update = 0;
 469          string_t *tmp_path;
 470          int ret;
 471          bool do_wait;
 472   
 473          now = time(NULL);
 474   
 475          lock_path = *lock_path_r =
 476[+]                 t_strconcat(dotlock->path, set->lock_suffix, NULL);
 477          stale_notify_threshold = set->stale_timeout / 2;
 478          max_wait_time = (flags & DOTLOCK_CREATE_FLAG_NONBLOCK) != 0 ? 0 :
 479                  now + set->timeout;
 480          tmp_path = t_str_new(256);
 481   
 482          memset(&lock_info, 0, sizeof(lock_info));
 483          lock_info.path = dotlock->path;
 484          lock_info.set = set;
 485          lock_info.lock_path = lock_path;
 486          lock_info.fd = -1;
 487          lock_info.use_io_notify = set->use_io_notify;
 488   
 489          last_notify = 0; do_wait = FALSE;
 490   
 491          do {
 492                  if (do_wait) {
 493                          if (prev_last_change != lock_info.last_change) {
 494                                  /* dotlock changed since last check,
 495                                     reset the wait time */
 496                                  lock_info.wait_usecs = LOCK_RANDOM_USLEEP_TIME;
 497                                  prev_last_change = lock_info.last_change;
 498                                  prev_wait_update = now;
 499                          } else if (prev_wait_update != now &&
 500                                     lock_info.wait_usecs < LOCK_MAX_WAIT_USECS) {
 501                                  /* we've been waiting for a while now, increase 
 502                                     the wait time to avoid wasting CPU */
 503                                  prev_wait_update = now;
 504                                  lock_info.wait_usecs += lock_info.wait_usecs/2;
 505                          }
 506                          dotlock_wait(&lock_info);
 507                          do_wait = FALSE;
 508                  }
 509   
 510[+]                 ret = check_lock(now, &lock_info);
expand/collapse

check_lock

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/file-dotlock.c)expand/collapse
Show more  
 206  static int check_lock(time_t now, struct lock_info *lock_info)
 207  {
 208          time_t stale_timeout = lock_info->set->stale_timeout;
 209          pid_t pid = -1;
 210          bool changed;
 211          int ret;
 212   
 213[+]         if ((ret = update_lock_info(now, lock_info, &changed)) != 0)
expand/collapse

update_lock_info

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/file-dotlock.c)expand/collapse
Show more  
 163  static int update_lock_info(time_t now, struct lock_info *lock_info,
 164                              bool *changed_r)
 165  {
 166          struct stat st;
 167   
 168          /* don't waste time flushing attribute cache the first time we're here.
 169             if it's stale we'll get back here soon. */
 170          if (lock_info->set->nfs_flush && lock_info->lock_stated) {
 171[+]                 nfs_flush_file_handle_cache(lock_info->lock_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  




Change Warning 7078.24944 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: