]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: fix readlink() usage
authorKarel Zak <kzak@redhat.com>
Fri, 18 Feb 2011 13:36:04 +0000 (14:36 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 18 Feb 2011 13:36:04 +0000 (14:36 +0100)
Reported-by: Steve Grubb <sgrubb@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk.c
shlibs/uuid/man/uuid_generate_time_safe.3 [deleted file]

index 1616f19727de215051a0c4dfb125d937621564e6..9b00826eb5af6bcd4d6e92e24f626e82b08bc977 100644 (file)
@@ -768,7 +768,7 @@ static int process_one_device(char *devname)
 {
        struct blkdev_cxt parent = {}, cxt = {};
        struct stat st;
-       char buf[PATH_MAX];
+       char buf[PATH_MAX + 1];
        dev_t disk = 0;
 
        if (stat(devname, &st) || !S_ISBLK(st.st_mode)) {
@@ -795,7 +795,7 @@ static int process_one_device(char *devname)
                                    major(st.st_rdev), minor(st.st_rdev));
                diskname = xstrdup(buf);
 
-               len = readlink(path, buf, sizeof(buf));
+               len = readlink(path, buf, PATH_MAX);
                if (len < 0) {
                        warn(_("%s: failed to read link"), path);
                        return EXIT_FAILURE;
diff --git a/shlibs/uuid/man/uuid_generate_time_safe.3 b/shlibs/uuid/man/uuid_generate_time_safe.3
deleted file mode 100644 (file)
index 8405486..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/uuid_generate.3