Loading lib/base64.c +6 −4 Original line number Diff line number Diff line Loading @@ -177,10 +177,12 @@ size_t Curl_base64_encode(const char *inp, size_t insize, char **outptr) ibuf[i] = 0; } obuf [0] = (ibuf [0] & 0xFC) >> 2; obuf [1] = ((ibuf [0] & 0x03) << 4) | ((ibuf [1] & 0xF0) >> 4); obuf [2] = ((ibuf [1] & 0x0F) << 2) | ((ibuf [2] & 0xC0) >> 6); obuf [3] = ibuf [2] & 0x3F; obuf[0] = (unsigned char) ((ibuf[0] & 0xFC) >> 2); obuf[1] = (unsigned char) (((ibuf[0] & 0x03) << 4) | \ ((ibuf[1] & 0xF0) >> 4)); obuf[2] = (unsigned char) (((ibuf[1] & 0x0F) << 2) | \ ((ibuf[2] & 0xC0) >> 6)); obuf[3] = (unsigned char) (ibuf[2] & 0x3F); switch(inputparts) { case 1: /* only one byte read */ Loading lib/http_ntlm.c +8 −8 Original line number Diff line number Diff line Loading @@ -304,13 +304,13 @@ static void setup_des_key(unsigned char *key_56, DES_cblock key; key[0] = key_56[0]; key[1] = ((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1); key[2] = ((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2); key[3] = ((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3); key[4] = ((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4); key[5] = ((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5); key[6] = ((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6); key[7] = (key_56[6] << 1) & 0xFF; key[1] = (unsigned char)(((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1)); key[2] = (unsigned char)(((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2)); key[3] = (unsigned char)(((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3)); key[4] = (unsigned char)(((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4)); key[5] = (unsigned char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5)); key[6] = (unsigned char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6)); key[7] = (unsigned char) ((key_56[6] << 1) & 0xFF); DES_set_odd_parity(&key); DES_set_key(&key, ks); Loading Loading @@ -357,7 +357,7 @@ static void mk_lm_hash(char *password, unsigned char *lmbuffer /* 21 bytes */) len = 14; for (i=0; i<len; i++) pw[i] = toupper(password[i]); pw[i] = (unsigned char)toupper(password[i]); for (; i<14; i++) pw[i] = 0; Loading lib/ssluse.c +1 −1 Original line number Diff line number Diff line Loading @@ -1806,7 +1806,7 @@ size_t Curl_ossl_version(char *buffer, size_t size) } else { if(ssleay_value&0xff0) { sub[0]=(char)((ssleay_value>>4)&0xff) + 'a' -1; sub[0]=(char)(((ssleay_value>>4)&0xff) + 'a' -1); } else sub[0]='\0'; Loading lib/telnet.c +2 −2 Original line number Diff line number Diff line Loading @@ -295,8 +295,8 @@ static void send_negotiation(struct connectdata *conn, int cmd, int option) struct SessionHandle *data = conn->data; buf[0] = CURL_IAC; buf[1] = cmd; buf[2] = option; buf[1] = (unsigned char)cmd; buf[2] = (unsigned char)option; bytes_written = swrite(conn->sock[FIRSTSOCKET], buf, 3); if(bytes_written < 0) { Loading lib/tftp.c +7 −7 Original line number Diff line number Diff line Loading @@ -228,25 +228,25 @@ void tftp_set_timeouts(tftp_state_data_t *state) static void setpacketevent(tftp_packet_t *packet, unsigned short num) { packet->data[0] = (num >> 8); packet->data[1] = (num & 0xff); packet->data[0] = (unsigned char)(num >> 8); packet->data[1] = (unsigned char)(num & 0xff); } static void setpacketblock(tftp_packet_t *packet, unsigned short num) { packet->data[2] = (num >> 8); packet->data[3] = (num & 0xff); packet->data[2] = (unsigned char)(num >> 8); packet->data[3] = (unsigned char)(num & 0xff); } static unsigned short getrpacketevent(tftp_packet_t *packet) { return (packet->data[0] << 8) | packet->data[1]; return (unsigned short)((packet->data[0] << 8) | packet->data[1]); } static unsigned short getrpacketblock(tftp_packet_t *packet) { return (packet->data[2] << 8) | packet->data[3]; return (unsigned short)((packet->data[2] << 8) | packet->data[3]); } static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event) Loading Loading @@ -355,7 +355,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event) } } /* This is the expected block. Reset counters and ACK it. */ state->block = rblock; state->block = (unsigned short)rblock; state->retries = 0; setpacketevent(&state->spacket, TFTP_EVENT_ACK); setpacketblock(&state->spacket, state->block); Loading Loading
lib/base64.c +6 −4 Original line number Diff line number Diff line Loading @@ -177,10 +177,12 @@ size_t Curl_base64_encode(const char *inp, size_t insize, char **outptr) ibuf[i] = 0; } obuf [0] = (ibuf [0] & 0xFC) >> 2; obuf [1] = ((ibuf [0] & 0x03) << 4) | ((ibuf [1] & 0xF0) >> 4); obuf [2] = ((ibuf [1] & 0x0F) << 2) | ((ibuf [2] & 0xC0) >> 6); obuf [3] = ibuf [2] & 0x3F; obuf[0] = (unsigned char) ((ibuf[0] & 0xFC) >> 2); obuf[1] = (unsigned char) (((ibuf[0] & 0x03) << 4) | \ ((ibuf[1] & 0xF0) >> 4)); obuf[2] = (unsigned char) (((ibuf[1] & 0x0F) << 2) | \ ((ibuf[2] & 0xC0) >> 6)); obuf[3] = (unsigned char) (ibuf[2] & 0x3F); switch(inputparts) { case 1: /* only one byte read */ Loading
lib/http_ntlm.c +8 −8 Original line number Diff line number Diff line Loading @@ -304,13 +304,13 @@ static void setup_des_key(unsigned char *key_56, DES_cblock key; key[0] = key_56[0]; key[1] = ((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1); key[2] = ((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2); key[3] = ((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3); key[4] = ((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4); key[5] = ((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5); key[6] = ((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6); key[7] = (key_56[6] << 1) & 0xFF; key[1] = (unsigned char)(((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1)); key[2] = (unsigned char)(((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2)); key[3] = (unsigned char)(((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3)); key[4] = (unsigned char)(((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4)); key[5] = (unsigned char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5)); key[6] = (unsigned char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6)); key[7] = (unsigned char) ((key_56[6] << 1) & 0xFF); DES_set_odd_parity(&key); DES_set_key(&key, ks); Loading Loading @@ -357,7 +357,7 @@ static void mk_lm_hash(char *password, unsigned char *lmbuffer /* 21 bytes */) len = 14; for (i=0; i<len; i++) pw[i] = toupper(password[i]); pw[i] = (unsigned char)toupper(password[i]); for (; i<14; i++) pw[i] = 0; Loading
lib/ssluse.c +1 −1 Original line number Diff line number Diff line Loading @@ -1806,7 +1806,7 @@ size_t Curl_ossl_version(char *buffer, size_t size) } else { if(ssleay_value&0xff0) { sub[0]=(char)((ssleay_value>>4)&0xff) + 'a' -1; sub[0]=(char)(((ssleay_value>>4)&0xff) + 'a' -1); } else sub[0]='\0'; Loading
lib/telnet.c +2 −2 Original line number Diff line number Diff line Loading @@ -295,8 +295,8 @@ static void send_negotiation(struct connectdata *conn, int cmd, int option) struct SessionHandle *data = conn->data; buf[0] = CURL_IAC; buf[1] = cmd; buf[2] = option; buf[1] = (unsigned char)cmd; buf[2] = (unsigned char)option; bytes_written = swrite(conn->sock[FIRSTSOCKET], buf, 3); if(bytes_written < 0) { Loading
lib/tftp.c +7 −7 Original line number Diff line number Diff line Loading @@ -228,25 +228,25 @@ void tftp_set_timeouts(tftp_state_data_t *state) static void setpacketevent(tftp_packet_t *packet, unsigned short num) { packet->data[0] = (num >> 8); packet->data[1] = (num & 0xff); packet->data[0] = (unsigned char)(num >> 8); packet->data[1] = (unsigned char)(num & 0xff); } static void setpacketblock(tftp_packet_t *packet, unsigned short num) { packet->data[2] = (num >> 8); packet->data[3] = (num & 0xff); packet->data[2] = (unsigned char)(num >> 8); packet->data[3] = (unsigned char)(num & 0xff); } static unsigned short getrpacketevent(tftp_packet_t *packet) { return (packet->data[0] << 8) | packet->data[1]; return (unsigned short)((packet->data[0] << 8) | packet->data[1]); } static unsigned short getrpacketblock(tftp_packet_t *packet) { return (packet->data[2] << 8) | packet->data[3]; return (unsigned short)((packet->data[2] << 8) | packet->data[3]); } static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event) Loading Loading @@ -355,7 +355,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event) } } /* This is the expected block. Reset counters and ACK it. */ state->block = rblock; state->block = (unsigned short)rblock; state->retries = 0; setpacketevent(&state->spacket, TFTP_EVENT_ACK); setpacketblock(&state->spacket, state->block); Loading