Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion htp/bstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ bstr *bstr_to_lowercase(bstr *b) {

size_t i = 0;
while (i < len) {
data[i] = tolower(data[i]);
data[i] = (uint8_t)tolower(data[i]);
i++;
}

Expand Down
6 changes: 3 additions & 3 deletions htp/htp_base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int htp_base64_decode(htp_base64_decoder *decoder, const void *_code_in, int len
}
fragment = (char) htp_base64_decode_single(*codechar++);
} while (fragment < 0);
*plainchar = (fragment & 0x03f) << 2;
*plainchar = (unsigned char) ((fragment & 0x03f) << 2);
/* fall through */

case step_b:
Expand All @@ -116,7 +116,7 @@ int htp_base64_decode(htp_base64_decoder *decoder, const void *_code_in, int len
fragment = (char) htp_base64_decode_single(*codechar++);
} while (fragment < 0);
*plainchar++ |= (fragment & 0x030) >> 4;
*plainchar = (fragment & 0x00f) << 4;
*plainchar = (unsigned char) ((fragment & 0x00f) << 4);
if (--length_out == 0) {
return plainchar - plaintext_out;
}
Expand All @@ -132,7 +132,7 @@ int htp_base64_decode(htp_base64_decoder *decoder, const void *_code_in, int len
fragment = (char) htp_base64_decode_single(*codechar++);
} while (fragment < 0);
*plainchar++ |= (fragment & 0x03c) >> 2;
*plainchar = (fragment & 0x003) << 6;
*plainchar = (unsigned char) ((fragment & 0x003) << 6);
if (--length_out == 0) {
return plainchar - plaintext_out;
}
Expand Down
4 changes: 2 additions & 2 deletions htp/htp_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,11 +724,11 @@ void htp_config_set_bestfit_map(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, void
void htp_config_set_bestfit_replacement_byte(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int b) {
if (ctx >= HTP_DECODER_CONTEXTS_MAX) return;

cfg->decoder_cfgs[ctx].bestfit_replacement_byte = b;
cfg->decoder_cfgs[ctx].bestfit_replacement_byte = (unsigned char) b;

if (ctx == HTP_DECODER_DEFAULTS) {
for (size_t i = 0; i < HTP_DECODER_CONTEXTS_MAX; i++) {
cfg->decoder_cfgs[i].bestfit_replacement_byte = b;
cfg->decoder_cfgs[i].bestfit_replacement_byte = (unsigned char) b;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion htp/htp_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ htp_status_t htp_connp_RES_BODY_CHUNKED_LENGTH(htp_connp_t *connp) {

// Have we reached the end of the line? Or is this not chunked after all?
if (connp->out_next_byte == LF ||
(!is_chunked_ctl_char(connp->out_next_byte) && !data_probe_chunk_length(connp))) {
(!is_chunked_ctl_char((unsigned char) connp->out_next_byte) && !data_probe_chunk_length(connp))) {
unsigned char *data;
size_t len;

Expand Down