Skip to content

Commit

Permalink
mime/base64: turning a runtime check into a debug assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
catenacyber committed Jul 12, 2023
1 parent 031f494 commit 09f0017
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/util-decode-mime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,9 +1184,8 @@ static uint32_t ProcessBase64Remainder(

/* Strip spaces in remainder */
for (uint8_t i = 0; i < state->bvr_len; i++) {
if (IsBase64Alphabet(state->bvremain[i])) {
block[cnt++] = state->bvremain[i];
}
DEBUG_VALIDATE_BUG_ON(!IsBase64Alphabet(state->bvremain[i]));
block[cnt++] = state->bvremain[i];
}

/* if we don't have 4 bytes see if we can fill it from `buf` */
Expand Down

0 comments on commit 09f0017

Please sign in to comment.