Package: boinc / 7.14.2+dfsg-3

client_app_maxpathlen.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Description: use the max value between len or MAXPATHLEN
--- a/client/file_names.cpp
+++ b/client/file_names.cpp
@@ -69,7 +69,7 @@ int make_soft_link(PROJECT* project, cha
 //
 void get_pathname(FILE_INFO* fip, char* path, int len) {
     PROJECT* p = fip->project;
-    char buf[MAXPATHLEN];
+    char buf[std::max(len,MAXPATHLEN)];
 
     // for testing purposes, it's handy to allow a FILE_INFO without
     // an associated PROJECT.
@@ -91,28 +91,28 @@ void get_pathname(FILE_INFO* fip, char*
 }
 
 void get_sched_request_filename(PROJECT& project, char* buf, int len) {
-    char url[1024];
+    char url[std::max(len,MAXPATHLEN)];
 
     escape_project_url(project.master_url, url);
     snprintf(buf, len, "%s%s.xml", SCHED_OP_REQUEST_BASE, url);
 }
 
 void get_sched_reply_filename(PROJECT& project, char* buf, int len) {
-    char url[1024];
+    char url[std::max(len,MAXPATHLEN)];
 
     escape_project_url(project.master_url, url);
     snprintf(buf, len, "%s%s.xml", SCHED_OP_REPLY_BASE, url);
 }
 
 void get_master_filename(PROJECT& project, char* buf, int len) {
-    char url[1024];
+    char url[std::max(len,MAXPATHLEN)];
 
     escape_project_url(project.master_url, url);
     snprintf(buf, len, "%s%s.xml", MASTER_BASE, url);
 }
 
 void job_log_filename(PROJECT& project, char* buf, int len) {
-    char url[1024];
+    char url[std::max(len,MAXPATHLEN)];
 
     escape_project_url(project.master_url, url);
     snprintf(buf, len, "%s%s.txt", JOB_LOG_BASE, url);
@@ -220,7 +220,7 @@ int make_slot_dir(int slot) {
 // delete unused stuff in the slots/ directory
 //
 void delete_old_slot_dirs() {
-    char filename[1024], path[MAXPATHLEN];
+    char filename[MAXPATHLEN], path[MAXPATHLEN];
     DIRREF dirp;
     int retval;