1 remove non-portable usage of strndupa
3 usage of strndupa is neither C99 nor POSIX,
4 it's a glibc invention, and a dangerous one since
5 alloca() is used behind the scenes which does not
6 give any guarantuees that it won't overflow the
9 --- kmod-15.org/libkmod/libkmod-util.c 2013-08-26 16:03:22.239000003 +0000
10 +++ kmod-15/libkmod/libkmod-util.c 2013-08-26 16:07:26.684000003 +0000
20 int mkdir_p(const char *path, int len, mode_t mode)
24 - start = strndupa(path, len);
25 + char buf[PATH_MAX+1];
26 + snprintf(buf, sizeof buf, "%s", path);
27 + assert(len < sizeof(buf));