# --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../musl/pkg/kmod/musl_strndupa.patch # Copyright (C) 2014 The OpenSDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- SDE-COPYRIGHT-NOTE-END --- http://git.alpinelinux.org/cgit/aports/plain/main/kmod/strndupa.patch diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c index df12433..142e767 100644 --- a/libkmod/libkmod-util.c +++ b/libkmod/libkmod-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; /*