diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/tcp/httpcore.c | 3 | ||||
-rw-r--r-- | src/net/tcp/iscsi.c | 2 | ||||
-rw-r--r-- | src/net/validator.c | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/net/tcp/httpcore.c b/src/net/tcp/httpcore.c index d94ab5f0..f14ce9a8 100644 --- a/src/net/tcp/httpcore.c +++ b/src/net/tcp/httpcore.c @@ -1081,7 +1081,8 @@ static char * http_basic_auth ( struct http_request *http ) { snprintf ( user_pw, sizeof ( user_pw ), "%s:%s", user, password ); /* Base64-encode the "user:password" string */ - base64_encode ( ( void * ) user_pw, user_pw_len, user_pw_base64 ); + base64_encode ( user_pw, user_pw_len, user_pw_base64, + sizeof ( user_pw_base64 ) ); /* Generate the authorisation string */ len = asprintf ( &auth, "Authorization: Basic %s\r\n", diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c index e553b214..0099bf5b 100644 --- a/src/net/tcp/iscsi.c +++ b/src/net/tcp/iscsi.c @@ -845,7 +845,7 @@ static int iscsi_large_binary_decode ( const char *encoded, uint8_t *raw, case 'x' : return base16_decode ( encoded, raw, len ); case 'b' : - return base64_decode ( encoded, raw ); + return base64_decode ( encoded, raw, len ); } } diff --git a/src/net/validator.c b/src/net/validator.c index 4c26cd1b..a01269da 100644 --- a/src/net/validator.c +++ b/src/net/validator.c @@ -254,7 +254,8 @@ static int validator_start_download ( struct validator *validator, /* Generate URI string */ len = snprintf ( uri_string, uri_string_len, "%s/%08x.der?subject=", crosscert, crc ); - base64_encode ( issuer->data, issuer->len, ( uri_string + len ) ); + base64_encode ( issuer->data, issuer->len, ( uri_string + len ), + ( uri_string_len - len ) ); DBGC ( validator, "VALIDATOR %p downloading cross-signed certificate " "from %s\n", validator, uri_string ); |