]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Increase buffer size for oauth access token to 2048
authortonypelle <tonypelle@gmail.com>
Wed, 4 Aug 2021 19:22:44 +0000 (12:22 -0700)
committertonypelle <tonypelle@gmail.com>
Wed, 4 Aug 2021 19:22:44 +0000 (12:22 -0700)
src/utils/oauth/oauth.c
src/utils/oauth/oauth.h
src/write_stackdriver.c

index a7ae75d020282113047182b36644c762226fe3bf..9d957205810ef345e7dea86f22b55d30020100e3 100644 (file)
@@ -46,7 +46,6 @@
  * monitoring api supports up to 100K bytes in one request, 64K is reasonable
  */
 #define MAX_BUFFER_SIZE 65536
-#define MAX_ENCODE_SIZE 2048
 
 struct oauth_s {
   char *url;
index b93c87b854591b7d1372d7b415853a502988b5de..be39736c68b39702c6352608fb51e81500d73f2a 100644 (file)
 #define GOOGLE_OAUTH_URL "https://www.googleapis.com/oauth2/v3/token"
 #endif
 
+#ifndef GOOGLE_OAUTH_ACCESS_TOKEN_SIZE
+#define GOOGLE_OAUTH_ACCESS_TOKEN_SIZE 2048
+#endif
+
 struct oauth_s;
 typedef struct oauth_s oauth_t;
 
index dfa1d7c0785a9db6ff5207f24aaa1b3728ae0b54..9e5bedc16591e3d8c13499196a8cd6e6cda57512 100644 (file)
@@ -96,8 +96,8 @@ static size_t wg_write_memory_cb(void *contents, size_t size,
 
 static char *wg_get_authorization_header(wg_callback_t *cb) { /* {{{ */
   int status = 0;
-  char access_token[256];
-  char authorization_header[256];
+  char access_token[GOOGLE_OAUTH_ACCESS_TOKEN_SIZE];
+  char authorization_header[GOOGLE_OAUTH_ACCESS_TOKEN_SIZE+32];
 
   assert((cb->auth != NULL) || gce_check());
   if (cb->auth != NULL)