X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev_utils_file.c;h=e4d5802ff899824b6960a7369e150108c6d66dd9;hb=9d534c0e764a6d2c20032d130e40e867133af149;hp=9bf60696d94ed74d9ddd79d5b854e918154dc1c2;hpb=27b77df44daebbd7597c572343105c16de099233;p=elogind.git diff --git a/udev_utils_file.c b/udev_utils_file.c index 9bf60696d..e4d5802ff 100644 --- a/udev_utils_file.c +++ b/udev_utils_file.c @@ -65,6 +65,9 @@ int delete_path(const char *path) strcpy (p, path); pos = strrchr(p, '/'); + if (pos == p || pos == NULL) + return 0; + while (1) { *pos = '\0'; pos = strrchr(p, '/');