Text   |  XML   |  ReML   |   Visible Warnings:

Null Pointer Dereference  at mail-index-map.c:141

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

mail_index_map_ext_get_next

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-map.c)expand/collapse
Show more  
 112  int mail_index_map_ext_get_next(struct mail_index_map *map,
 113                                  unsigned int *offset_p,
 114                                  const struct mail_index_ext_header **ext_hdr_r,
 115                                  const char **name_r)
 116  {
 117          const struct mail_index_ext_header *ext_hdr;
 118          unsigned int offset, name_offset;
 119   
 120          offset = *offset_p;
 121          *name_r = "";
 122   
 123          /* Extension header contains:
 124             - struct mail_index_ext_header
 125             - name (not 0-terminated)
 126             - 64bit alignment padding 
 127             - extension header contents 
 128             - 64bit alignment padding 
 129          */
 130          name_offset = offset + sizeof(*ext_hdr);
 131          ext_hdr = CONST_PTR_OFFSET(map->hdr_base, offset);
 132          if (offset + sizeof(*ext_hdr) >= map->hdr.header_size)
 133                  return -1;
 134   
 135          offset += mail_index_map_ext_hdr_offset(ext_hdr->name_size);
 136          if (offset > map->hdr.header_size)
 137                  return -1;
 138   
 139          *name_r = t_strndup(CONST_PTR_OFFSET(map->hdr_base, name_offset),
 140[+]                             ext_hdr->name_size);
 141          if (strcmp(*name_r, str_sanitize(*name_r, -1)) != 0) {
Show more  




Change Warning 7212.24637 : Null Pointer Dereference

Priority:
State:
Finding:
Owner:
Note: