summaryrefslogtreecommitdiff
path: root/media-sound/mt-daapd/files/mt-daapd-0.2.4.2-musl.patch
blob: 707b7ac3b8280f857b8299243b3e52a8e57cbb0b (plain)
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
https://bugs.gentoo.org/716010
--- a/src/mp3-scanner.c
+++ b/src/mp3-scanner.c
@@ -378,7 +378,7 @@ int scan_init(char *path) {
  */
 int scan_path(char *path) {
     DIR *current_dir;
-    char de[sizeof(struct dirent) + MAXNAMLEN + 1]; /* overcommit for solaris */
+    char de[sizeof(struct dirent) + NAME_MAX + 1]; /* overcommit for solaris */
     struct dirent *pde;
     int err;
     char mp3_path[PATH_MAX];
--- a/src/webserver.c
+++ b/src/webserver.c
@@ -1029,14 +1029,14 @@ int ws_returnerror(WS_CONNINFO *pwsc,int error, char *description) {
  * and serves it up
  */
 void ws_defaulthandler(WS_PRIVATE *pwsp, WS_CONNINFO *pwsc) {
-    char path[MAXPATHLEN];
-    char resolved_path[MAXPATHLEN];
+    char path[PATH_MAX];
+    char resolved_path[PATH_MAX];
     int file_fd;
     off_t len;
 
     DPRINTF(E_SPAM,L_WS,"Entering ws_defaulthandler\n");
 
-    snprintf(path,MAXPATHLEN,"%s/%s",pwsp->wsconfig.web_root,pwsc->uri);
+    snprintf(path,PATH_MAX,"%s/%s",pwsp->wsconfig.web_root,pwsc->uri);
     if(!realpath(path,resolved_path)) {
         pwsc->error=errno;
         DPRINTF(E_WARN,L_WS,"Exiting ws_defaulthandler: Cannot resolve %s\n",path);