Text   |  XML   |  ReML   |   Visible Warnings:

Use After Free  at mail-transaction-log.c:25

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

mail_transaction_log_rotate

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-transaction-log.c)expand/collapse
Show more  
 237  int mail_transaction_log_rotate(struct mail_transaction_log *log, bool reset)
 238  {
 239          struct mail_transaction_log_file *file;
 240          const char *path = log->head->filepath;
 241          struct stat st;
 242   
 243          i_assert(log->head->locked);
 244   
 245          if (MAIL_INDEX_IS_IN_MEMORY(log->index)) {
 246[+]                 file = mail_transaction_log_file_alloc_in_memory(log);
 247                  if (reset) {
 248                          file->hdr.prev_file_seq = 0;
 249                          file->hdr.prev_file_offset = 0;
 250                  }
 251          } else {
 252                  /* we're locked, we shouldn't need to worry about ESTALE 
 253                     problems in here. */
 254                  if (fstat(log->head->fd, &st) < 0) {
 255                          mail_index_file_set_syscall_error(log->index,
 256                                  file->filepath, "fstat()");
 257                          return -1;
 258                  }
 259   
 260                  file = mail_transaction_log_file_alloc(log, path);
 261   
 262                  file->st_dev = st.st_dev;
 263                  file->st_ino = st.st_ino;
 264                  file->last_mtime = st.st_mtime;
 265                  file->last_size = st.st_size;
 266   
 267                  if (mail_transaction_log_file_create(file, reset) < 0) {
 268                          mail_transaction_log_file_free(&file);
 269                          return -1;
 270                  }
 271          }
 272   
 273          if (--log->head->refcount == 0)
 274[+]                 mail_transaction_logs_clean(log);
 275          else 
 276                  mail_transaction_log_file_unlock(log->head);
 277[+]         mail_transaction_log_set_head(log, file);
expand/collapse

mail_transaction_log_set_head

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-transaction-log.c)expand/collapse
Show more  
 20  mail_transaction_log_set_head(struct mail_transaction_log *log,
 21                                struct mail_transaction_log_file *file)
 22  {
 23          i_assert(log->head != file);
 24   
 25          file->refcount++;
Show more  
Show more  




Change Warning 11441.25561 : Use After Free

Priority:
State:
Finding:
Owner:
Note: