diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | README | LICENSE

commit 018ff7077ab1cabb6a3f9b7072f0790d57897f77
parent b45b1959e4df9d746b782e86affe64063e3345be
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date:   Thu,  6 Jun 2024 16:16:37 +0200

fix(caldav): bearer token buffer overflow

Strlen excludes the terminating null byte.

Diffstat:
Msrc/caldav.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/caldav.c b/src/caldav.c @@ -437,7 +437,7 @@ char* caldav_req(struct tm* date, char* url, char* http_method, char* postfields // construct header fields struct curl_slist *header = NULL; - char bearer_token[strlen("Authorization: Bearer")+strlen(access_token)]; + char bearer_token[strlen("Authorization: Bearer ") + strlen(access_token) + 1]; sprintf(bearer_token, "Authorization: Bearer %s", access_token); char depth_header[strlen("Depth: 0") + 1]; sprintf(depth_header, "Depth: %i", depth);