Skip to content

Commit

Permalink
base64: Fixed decode buffer size estimation
Browse files Browse the repository at this point in the history
Fixed required result buffer size underestimation in base64_estimate_decode_size() function.
  • Loading branch information
mjurczak authored and maribu committed Jul 2, 2020
1 parent 325b7a8 commit f8ac003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/include/base64.h
Expand Up @@ -41,7 +41,7 @@ extern "C" {
*/
static inline size_t base64_estimate_decode_size(size_t base64_in_size)
{
return ((base64_in_size / 4) * 3);
return (((base64_in_size + 3) / 4) * 3);
}

/**
Expand Down

0 comments on commit f8ac003

Please sign in to comment.