Increase buffer size
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
#include <errno.h>
|
||||
|
||||
#define ARGS_DELIM " "
|
||||
#define KUBECONFIG_EXEC_ARGS_BUFFER_SIZE 1024
|
||||
#define KUBECONFIG_EXEC_COMMAND_BUFFER_SIZE 1024
|
||||
#define KUBECONFIG_STRING_BUFFER_SIZE 1024
|
||||
#define KUBECONFIG_EXEC_ARGS_BUFFER_SIZE 4096
|
||||
#define KUBECONFIG_EXEC_COMMAND_BUFFER_SIZE 4096
|
||||
#define KUBECONFIG_STRING_BUFFER_SIZE 4096
|
||||
#define KUBECONFIG_EXEC_RESULT_BUFFER_SIZE 4096
|
||||
|
||||
int kube_exec_and_get_result(ExecCredential_t * exec_credential, const kubeconfig_property_t * exec)
|
||||
|
||||
@@ -93,6 +93,10 @@ static int setApiKeys(list_t ** pApiKeys, const char *token)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strlen(BEARER_TOKEN_TEMPLATE) + strlen(token) >= BEARER_TOKEN_BUFFER_SIZE) {
|
||||
fprintf(stderr, "%s: The buffer for bearer token is insufficient.\n", fname);
|
||||
return -1;
|
||||
}
|
||||
char tokenValue[BEARER_TOKEN_BUFFER_SIZE];
|
||||
memset(tokenValue, 0, sizeof(tokenValue));
|
||||
snprintf(tokenValue, BEARER_TOKEN_BUFFER_SIZE, BEARER_TOKEN_TEMPLATE, token);
|
||||
|
||||
@@ -7,7 +7,7 @@ extern "C" {
|
||||
|
||||
#define AUTH_TOKEN_KEY "Authorization"
|
||||
#define BEARER_TOKEN_TEMPLATE "Bearer %s"
|
||||
#define BEARER_TOKEN_BUFFER_SIZE 2048
|
||||
#define BEARER_TOKEN_BUFFER_SIZE 4096
|
||||
#define BASIC_TOKEN_TEMPLATE "Basic %s"
|
||||
#define BASIC_TOKEN_BUFFER_SIZE 1024
|
||||
|
||||
|
||||
Reference in New Issue
Block a user