Skip to content

Commit

Permalink
lib-mail: message_binary_part_deserialize(): Return error if body lin…
Browse files Browse the repository at this point in the history
…e count is too large

The input was unsigned int, so output must also fit into unsigned int.
  • Loading branch information
sirainen committed Dec 23, 2016
1 parent c12b91e commit 50593e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-mail/message-binary-part.c
Expand Up @@ -31,7 +31,8 @@ int message_binary_part_deserialize(pool_t pool, const void *data, size_t size,
if (numpack_decode(&p, end, &n1) < 0 ||
numpack_decode(&p, end, &n2) < 0 ||
numpack_decode(&p, end, &n3) < 0 ||
numpack_decode(&p, end, &n4) < 0)
numpack_decode(&p, end, &n4) < 0 ||
n4 > UINT_MAX)
return -1;
part->physical_pos = n1;
part->binary_hdr_size = n2;
Expand Down

0 comments on commit 50593e2

Please sign in to comment.