summaryrefslogtreecommitdiff
path: root/package/kmod/patches/patch-libkmod_libkmod-util_c
blob: 330fce4564c560d0f0842c6937f22e951c587980 (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
--- kmod-15.orig/libkmod/libkmod-util.c	2013-07-15 17:45:31.000000000 +0200
+++ kmod-15/libkmod/libkmod-util.c	2013-12-21 18:02:49.000000000 +0100
@@ -28,6 +28,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
+#include <limits.h>
 #include <ctype.h>
 
 #include "libkmod.h"
@@ -323,8 +324,12 @@ static inline int is_dir(const char *pat
 int mkdir_p(const char *path, int len, mode_t mode)
 {
 	char *start, *end;
+	char buf[PATH_MAX+1];
 
-	start = strndupa(path, len);
+	snprintf(buf, sizeof buf, "%s", path);
+	assert(len < sizeof(buf));
+	buf[len] = 0;
+	start = buf;
 	end = start + len;
 
 	/*