Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix base64 test bug
On some systems, the base64_test() call would fail because
an output buffer was not zeroized befure using it.
  • Loading branch information
lcn2 committed Jun 1, 2017
commit 9a32f8f6dc46c362a5dc3faad2be0868ef8aeb1b
1 change: 1 addition & 0 deletions base64_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ int base64_test()
int idx;

for (idx = 0; idx < 3; idx++) {
memset(buf, 0, sizeof(buf));
buf_len = base64_encode(text[idx], buf, strlen((const char *)text[idx]), 1);
pass = pass && ((buf_len == strlen((const char *)code[idx])) &&
(buf_len == base64_encode(text[idx], NULL, strlen((const char *)text[idx]), 1)));
Expand Down