Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at imem.c:25

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

mail_transaction_log_refresh

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-transaction-log.c)expand/collapse
Show more  
 282  mail_transaction_log_refresh(struct mail_transaction_log *log, bool nfs_flush)
 283  {
 284          struct mail_transaction_log_file *file;
 285          struct stat st;
 286          const char *path;
 287   
 288          i_assert(log->head != NULL);
 289   
 290          if (MAIL_TRANSACTION_LOG_FILE_IN_MEMORY(log->head))
 291                  return 0;
 292   
 293          path = t_strconcat(log->index->filepath,
 294[+]                            MAIL_TRANSACTION_LOG_SUFFIX, NULL);
 295          if (log->index->nfs_flush && nfs_flush)
 296                  nfs_flush_file_handle_cache(path);
 297[+]         if (nfs_safe_stat(path, &st) < 0) {
 298                  if (errno != ENOENT) {
 299                          mail_index_file_set_syscall_error(log->index, path,
 300                                                            "stat()");
 301                          return -1;
 302                  }
 303                  /* the file should always exist at this point. if it doesn't,
 304                     someone deleted it manually while the index was open. try to
 305                     handle this nicely by creating a new log file. */
 306                  file = log->head;
 307                  if (mail_transaction_log_create(log, FALSE) < 0)
 308                          return -1;
 309                  i_assert(file->refcount > 0);
 310                  file->refcount--;
 311                  log->index->need_recreate = TRUE;
 312                  return 0;
 313          } else if (log->head->st_ino == st.st_ino &&
 314                     CMP_DEV_T(log->head->st_dev, st.st_dev)) {
 315                  /* NFS: log files get rotated to .log.2 files instead
 316                     of being unlinked, so we don't bother checking if 
 317                     the existing file has already been unlinked here 
 318                     (in which case inodes could match but point to
 319                     different files) */
 320                  return 0;
 321          }
 322   
 323[+]         file = mail_transaction_log_file_alloc(log, path);
expand/collapse

mail_transaction_log_file_alloc

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-transaction-log-file.c)expand/collapse
Show more  
 48  struct mail_transaction_log_file *
 49  mail_transaction_log_file_alloc(struct mail_transaction_log *log,
 50                                  const char *path)
 51  {
 52          struct mail_transaction_log_file *file;
 53   
 54          file = i_new(struct mail_transaction_log_file, 1);
 55          file->log = log;
 56[+]         file->filepath = i_strdup(path);
expand/collapse

i_strdup

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/imem.c)expand/collapse
Show more  
 23  char *i_strdup(const char *str)
 24  {
 25      char *rv = strdup( str );
Show more  
Show more  
Show more  




Change Warning 11821.25647 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: