1
0

patch-libkmod_libkmod-util_c 617 B

123456789101112131415161718192021222324
  1. --- kmod-15.orig/libkmod/libkmod-util.c 2013-07-15 17:45:31.000000000 +0200
  2. +++ kmod-15/libkmod/libkmod-util.c 2013-12-21 18:02:49.000000000 +0100
  3. @@ -28,6 +28,7 @@
  4. #include <unistd.h>
  5. #include <errno.h>
  6. #include <string.h>
  7. +#include <limits.h>
  8. #include <ctype.h>
  9. #include "libkmod.h"
  10. @@ -323,8 +324,12 @@ static inline int is_dir(const char *pat
  11. int mkdir_p(const char *path, int len, mode_t mode)
  12. {
  13. char *start, *end;
  14. + char buf[PATH_MAX+1];
  15. - start = strndupa(path, len);
  16. + snprintf(buf, sizeof buf, "%s", path);
  17. + assert(len < sizeof(buf));
  18. + buf[len] = 0;
  19. + start = buf;
  20. end = start + len;
  21. /*