X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fwebcit.c;h=b615dbc5a81bf43d1575fde006f3c8583fbbb854;hb=abeb8adc38f9d55fcb6cb3d076f57239b0a9a4d5;hp=be1c6a68fd1b097d6ec60aec80908a8159c147c6;hpb=d96f96eef3dfd036a06a52740b69ba10cede6d30;p=citadel.git diff --git a/webcit/webcit.c b/webcit/webcit.c index be1c6a68f..b615dbc5a 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -653,7 +653,7 @@ void output_mimepart() if (buf[0] == '2') { bytes = extract_long(&buf[4], 0); content = malloc(bytes + 2); - extract(content_type, &buf[4], 3); + extract_token(content_type, &buf[4], 3, '|', sizeof content_type); output_headers(0, 0, 0, 0, 0, 0, 0); read_server_binary(content, bytes); serv_puts("CLOS"); @@ -684,7 +684,7 @@ char *load_mimepart(long msgnum, char *partnum) serv_gets(buf); if (buf[0] == '2') { bytes = extract_long(&buf[4], 0); - extract(content_type, &buf[4], 3); + extract_token(content_type, &buf[4], 3, '|', sizeof content_type); content = malloc(bytes + 2); read_server_binary(content, bytes); @@ -904,7 +904,7 @@ void session_loop(struct httprequest *req) strcpy(cmd, hptr->line); hptr = hptr->next; - extract_token(method, cmd, 0, ' '); + extract_token(method, cmd, 0, ' ', sizeof method); extract_action(action, cmd); while (hptr != NULL) { @@ -914,12 +914,14 @@ void session_loop(struct httprequest *req) if (!strncasecmp(buf, "Cookie: webcit=", 15)) { safestrncpy(cookie, &buf[15], sizeof cookie); cookie_to_stuff(cookie, NULL, - c_username, c_password, c_roomname); + c_username, sizeof c_username, + c_password, sizeof c_password, + c_roomname, sizeof c_roomname); } else if (!strncasecmp(buf, "Authorization: Basic ", 21)) { CtdlDecodeBase64(c_httpauth_string, &buf[21], strlen(&buf[21])); - extract_token(c_httpauth_user, c_httpauth_string, 0, ':'); - extract_token(c_httpauth_pass, c_httpauth_string, 1, ':'); + extract_token(c_httpauth_user, c_httpauth_string, 0, ':', sizeof c_httpauth_user); + extract_token(c_httpauth_pass, c_httpauth_string, 1, ':', sizeof c_httpauth_pass); } else if (!strncasecmp(buf, "Content-length: ", 16)) { ContentLength = atoi(&buf[16]);