Skip to content

Commit

Permalink
l4util/base64: Fix buffer overflow in specific input
Browse files Browse the repository at this point in the history
See #6

Change-Id: I7199f22807c8eed3ca46965f079c5a694ca2e817
  • Loading branch information
admlck authored and kk-infra committed May 7, 2024
1 parent 4702a08 commit dfc58be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion l4util/lib/src/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ L4_CV void base64_encode( const char *infile, unsigned int in_size, char **outfi
unsigned char in[3], out[4];
int i, len = 0;
unsigned int in_count=0, out_count=0;
char *temp=malloc(in_size*2);//to be on the safe side;
char *temp=malloc(in_size < 5 ? 9 : in_size*2);//to be on the safe side;
if (!temp)
{
*outfile = NULL;
Expand Down

0 comments on commit dfc58be

Please sign in to comment.