Integer Overflow of Allocation Size at mail-cache-compress.c:129 |
No properties have been set. edit properties |
Jump to warning location ↓ | warning details... |
| |
mail_cache_compress_get_fields (/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-cache-compress.c)![]() | |||||||||||||||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||||||||||||||
113 | mail_cache_compress_get_fields(struct mail_cache_copy_context *ctx, | ||||||||||||||||||||||||||||||||||||||
114 | unsigned int used_fields_count) | ||||||||||||||||||||||||||||||||||||||
115 | { | ||||||||||||||||||||||||||||||||||||||
116 | struct mail_cache *cache = ctx->cache; | ||||||||||||||||||||||||||||||||||||||
117 | struct mail_cache_field *field; | ||||||||||||||||||||||||||||||||||||||
118 | unsigned int i, j, idx; | ||||||||||||||||||||||||||||||||||||||
119 | |||||||||||||||||||||||||||||||||||||||
120 | /* Make mail_cache_header_fields_get() return the fields in | ||||||||||||||||||||||||||||||||||||||
121 | the same order as we saved them. */ | ||||||||||||||||||||||||||||||||||||||
122 | memcpy(cache->field_file_map, ctx->field_file_map, | ||||||||||||||||||||||||||||||||||||||
123 | sizeof(uint32_t) * cache->fields_count); | ||||||||||||||||||||||||||||||||||||||
124 | |||||||||||||||||||||||||||||||||||||||
125 | /* reverse mapping */ | ||||||||||||||||||||||||||||||||||||||
126 | cache->file_fields_count = used_fields_count; | ||||||||||||||||||||||||||||||||||||||
127 | i_free(cache->file_field_map); | ||||||||||||||||||||||||||||||||||||||
128 | cache->file_field_map = used_fields_count == 0 ? NULL : | ||||||||||||||||||||||||||||||||||||||
129 | [+] | i_new(unsigned int, used_fields_count);
| |||||||||||||||||||||||||||||||||||||
![]() |
| ||||||||||||||||||||||||||||||||||||||
![]() |