v0.1.6 - Just catching up
This commit is contained in:
12
src/bud04.c
12
src/bud04.c
@@ -427,8 +427,16 @@ void handle_mirror_request(void) {
|
||||
const char* extension = mime_to_extension(content_type_final);
|
||||
|
||||
// Save file to storage directory using global g_storage_dir variable
|
||||
char filepath[512];
|
||||
snprintf(filepath, sizeof(filepath), "%s/%s%s", g_storage_dir, sha256_hex, extension);
|
||||
char filepath[4096];
|
||||
int filepath_len = snprintf(filepath, sizeof(filepath), "%s/%s%s", g_storage_dir, sha256_hex, extension);
|
||||
if (filepath_len >= (int)sizeof(filepath)) {
|
||||
free_mirror_download(download);
|
||||
send_error_response(500, "file_error",
|
||||
"File path too long",
|
||||
"Internal server error during file path construction");
|
||||
log_request("PUT", "/mirror", uploader_pubkey ? "authenticated" : "anonymous", 500);
|
||||
return;
|
||||
}
|
||||
|
||||
FILE* outfile = fopen(filepath, "wb");
|
||||
if (!outfile) {
|
||||
|
||||
Reference in New Issue
Block a user