Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at buffer.c:128

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

mail_transaction_log_file_map

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-transaction-log-file.c)expand/collapse
Show more  
 1467  int mail_transaction_log_file_map(struct mail_transaction_log_file *file,
 1468                                    uoff_t start_offset, uoff_t end_offset)
 1469  {
 1470          struct mail_index *index = file->log->index;
 1471          size_t size;
 1472          int ret;
 1473   
 1474          if (file->hdr.indexid == 0) {
 1475                  /* corrupted */
 1476                  return 0;
 1477          }
 1478   
 1479          i_assert(start_offset >= file->hdr.hdr_size);
 1480          i_assert(start_offset <= end_offset);
 1481   
 1482          if (index->log_locked && file == file->log->head &&
 1483              end_offset == (uoff_t)-1) {
 1484                  /* we're not interested of going further than sync_offset */
 1485                  if (log_file_map_check_offsets(file, start_offset,
 1486                                                 end_offset) == 0)
 1487                          return 0;
 1488                  i_assert(start_offset <= file->sync_offset);
 1489                  end_offset = file->sync_offset;
 1490          }
 1491   
 1492          if (file->buffer != NULL && file->buffer_offset <= start_offset) {
 1493                  /* see if we already have it */
 1494                  size = buffer_get_used_size(file->buffer);
 1495                  if (file->buffer_offset + size >= end_offset)
 1496                          return 1;
 1497          }
 1498   
 1499          if (MAIL_TRANSACTION_LOG_FILE_IN_MEMORY(file)) {
 1500                  if (start_offset < file->buffer_offset) {
 1501                          /* we had moved the log to memory but failed to read 
 1502                             the beginning of the log file */
 1503                          mail_index_set_error(index,
 1504                                  "%s: Beginning of the log isn't available",
 1505                                  file->filepath);
 1506                          return 0;
 1507                  }
 1508                  return log_file_map_check_offsets(file, start_offset,
 1509                                                    end_offset);
 1510          }
 1511   
 1512          if (start_offset > file->sync_offset)
 1513                  mail_transaction_log_file_skip_to_head(file);
 1514          if (start_offset > file->sync_offset) {
 1515                  /* although we could just skip over the unwanted data, we have
 1516                     to sync everything so that modseqs are calculated 
 1517                     correctly */
 1518                  start_offset = file->sync_offset;
 1519          }
 1520   
 1521          if (!index->mmap_disable)
 1522                  ret = mail_transaction_log_file_map_mmap(file, start_offset);
 1523          else {
 1524[+]                 mail_transaction_log_file_munmap(file);
expand/collapse

mail_transaction_log_file_munmap

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-transaction-log-file.c)expand/collapse
Show more  
 1399  mail_transaction_log_file_munmap(struct mail_transaction_log_file *file)
 1400  {
 1401          if (file->mmap_base == NULL)
 1402                  return;
 1403   
 1404          if (munmap(file->mmap_base, file->mmap_size) < 0) {
 1405                  mail_index_file_set_syscall_error(file->log->index,
 1406                                                    file->filepath, "munmap()");
 1407          }
 1408          file->mmap_base = NULL;
 1409          file->mmap_size = 0;
 1410[+]         buffer_free(&file->buffer);
expand/collapse

buffer_free

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/buffer.c)expand/collapse
Show more  
 123  void buffer_free(buffer_t **_buf)
 124  {
 125          struct real_buffer *buf = (struct real_buffer *)*_buf;
 126   
 127          *_buf = NULL;
 128          if (buf->alloced)
Show more  
Show more  
Show more  




Change Warning 7205.25528 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: