Integer Overflow of Allocation Size at mail-index-transaction.c:1321 |
No properties have been set. edit properties |
Jump to warning location ↓ | warning details... |
| |
mail_index_keywords_create (/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-index/mail-index-transaction.c)![]() | |||||||||||||||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||||||||||||||
1305 | struct mail_keywords * | ||||||||||||||||||||||||||||||||||||||
1306 | mail_index_keywords_create(struct mail_index *index, | ||||||||||||||||||||||||||||||||||||||
1307 | const char *const keywords[]) | ||||||||||||||||||||||||||||||||||||||
1308 | { | ||||||||||||||||||||||||||||||||||||||
1309 | struct mail_keywords *k; | ||||||||||||||||||||||||||||||||||||||
1310 | unsigned int src, dest, i, count; | ||||||||||||||||||||||||||||||||||||||
1311 | |||||||||||||||||||||||||||||||||||||||
1312 | [+] | count = str_array_length(keywords); | |||||||||||||||||||||||||||||||||||||
1313 | if (count == 0) { | ||||||||||||||||||||||||||||||||||||||
1314 | k = i_new(struct mail_keywords, 1); | ||||||||||||||||||||||||||||||||||||||
1315 | k->index = index; | ||||||||||||||||||||||||||||||||||||||
1316 | return k; | ||||||||||||||||||||||||||||||||||||||
1317 | } | ||||||||||||||||||||||||||||||||||||||
1318 | |||||||||||||||||||||||||||||||||||||||
1319 | /* @UNSAFE */ | ||||||||||||||||||||||||||||||||||||||
1320 | k = i_malloc(sizeof(struct mail_keywords) + | ||||||||||||||||||||||||||||||||||||||
1321 | [+] | (sizeof(k->idx) * (count-1)));
| |||||||||||||||||||||||||||||||||||||
![]() |
| ||||||||||||||||||||||||||||||||||||||
![]() |