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_mmap

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-transaction-log-file.c)expand/collapse
Show more  
 1414  mail_transaction_log_file_map_mmap(struct mail_transaction_log_file *file,
 1415                                     uoff_t start_offset)
 1416  {
 1417          struct stat st;
 1418          int ret;
 1419   
 1420          /* we are going to mmap() this file, but it's not necessarily
 1421             mmaped currently. */
 1422          i_assert(file->buffer_offset == 0 || file->mmap_base == NULL);
 1423          i_assert(file->mmap_size == 0 || file->mmap_base != NULL);
 1424   
 1425          if (fstat(file->fd, &st) < 0) {
 1426                  mail_index_file_set_syscall_error(file->log->index,
 1427                                                    file->filepath, "fstat()");
 1428                  return -1;
 1429          }
 1430          file->last_size = st.st_size;
 1431   
 1432          if ((uoff_t)st.st_size < file->sync_offset) {
 1433                  mail_transaction_log_file_set_corrupted(file,
 1434                                                          "file size shrank");
 1435                  return 0;
 1436          }
 1437   
 1438          if (file->buffer != NULL && file->buffer_offset <= start_offset &&
 1439              (uoff_t)st.st_size == file->buffer_offset + file->buffer->used) {
 1440                  /* we already have the whole file mapped */
 1441                  if ((ret = mail_transaction_log_file_sync(file)) < 0)
 1442                          return 0;
 1443                  if (ret > 0)
 1444                          return 1;
 1445                  /* size changed, re-mmap */
 1446          }
 1447   
 1448          do {
 1449[+]                 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 7204.25501 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: