Loading server_side/c/auth.c +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp) { unsigned char* base64_urlsafe_decode(const char *input, int length, int *out_length) { // Convert base64 URL-safe to base64 standard char *converted = malloc(length + 2); // extra bytes for potential padding char *converted = malloc(length + 3); // extra bytes for potential padding strcpy(converted, input); for (int i = 0; i < length; ++i) { if (converted[i] == '-') converted[i] = '+'; Loading server_side/c/config.c +3 −2 Original line number Diff line number Diff line Loading @@ -17,12 +17,13 @@ int parse_config(const char* fname, json_config_t* config) { fseek (f, 0, SEEK_END); length = ftell (f); fseek (f, 0, SEEK_SET); buffer = malloc (length); buffer = malloc (length+1); if (!buffer) { return 1; } fread (buffer, 1, length, f); fclose (f); buffer[length]=0; cJSON *config_json = cJSON_Parse(buffer); if (config_json == NULL) Loading Loading
server_side/c/auth.c +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp) { unsigned char* base64_urlsafe_decode(const char *input, int length, int *out_length) { // Convert base64 URL-safe to base64 standard char *converted = malloc(length + 2); // extra bytes for potential padding char *converted = malloc(length + 3); // extra bytes for potential padding strcpy(converted, input); for (int i = 0; i < length; ++i) { if (converted[i] == '-') converted[i] = '+'; Loading
server_side/c/config.c +3 −2 Original line number Diff line number Diff line Loading @@ -17,12 +17,13 @@ int parse_config(const char* fname, json_config_t* config) { fseek (f, 0, SEEK_END); length = ftell (f); fseek (f, 0, SEEK_SET); buffer = malloc (length); buffer = malloc (length+1); if (!buffer) { return 1; } fread (buffer, 1, length, f); fclose (f); buffer[length]=0; cJSON *config_json = cJSON_Parse(buffer); if (config_json == NULL) Loading