Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at mail-index-write.c:57

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

mail_index_recreate

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-write.c)expand/collapse
Show more  
 16  static int mail_index_recreate(struct mail_index *index)
 17  {
 18          struct mail_index_map *map = index->map;
 19          struct ostream *output;
 20          unsigned int base_size;
 21          const char *path;
 22          int ret = 0, fd;
 23   
 24          i_assert(!MAIL_INDEX_IS_IN_MEMORY(index));
 25          i_assert(map->hdr.indexid == index->indexid);
 26   
 27[+]         fd = mail_index_create_tmp_file(index, &path);
 28          if (fd == -1)
 29                  return -1;
 30   
 31          output = o_stream_create_fd_file(fd, 0, FALSE);
 32          o_stream_cork(output);
 33   
 34          base_size = I_MIN(map->hdr.base_header_size, sizeof(map->hdr));
 35          if (o_stream_send(output, &map->hdr, base_size) < 0 ||
 36              o_stream_send(output, CONST_PTR_OFFSET(map->hdr_base, base_size),
 37                            map->hdr.header_size - base_size) < 0 ||
 38              o_stream_send(output, map->rec_map->records,
 39                            map->rec_map->records_count *
 40                            map->hdr.record_size) < 0 ||
 41[+]             o_stream_flush(output) < 0) {
 42                  mail_index_file_set_syscall_error(index, path, "write()");
 43                  ret = -1;
 44          }
 45          o_stream_destroy(&output);
 46   
 47          if (ret == 0 && !index->fsync_disable && fdatasync(fd) < 0) {
 48                  mail_index_file_set_syscall_error(index, path, "fdatasync()");
 49                  ret = -1;
 50          }
 51   
 52          if (close(fd) < 0) {
 53                  mail_index_file_set_syscall_error(index, path, "close()");
 54                  ret = -1;
 55          }
 56   
 57          if (ret == 0 && rename(path, index->filepath) < 0) {
Show more  




Change Warning 7218.25023 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: