summaryrefslogtreecommitdiff
path: root/system/kmod/strndupa.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/kmod/strndupa.patch')
-rw-r--r--system/kmod/strndupa.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/system/kmod/strndupa.patch b/system/kmod/strndupa.patch
new file mode 100644
index 000000000..d4527140e
--- /dev/null
+++ b/system/kmod/strndupa.patch
@@ -0,0 +1,15 @@
+diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c
+index df12433..142e767 100644
+--- a/shared/util.c
++++ b/shared/util.c
+@@ -334,7 +334,9 @@ int mkdir_p(const char *path, int len, mode_t mode)
+ {
+ char *start, *end;
+
+- start = strndupa(path, len);
++ start = alloca(len+1);
++ strncpy(start, path, len);
++ start[len] = '\0';
+ end = start + len;
+
+ /*