Increase buffer size in find_loop_by_file()
authorHannes Reinecke <hare@suse.de>
Tue, 21 Oct 2008 08:22:16 +0000 (10:22 +0200)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Tue, 21 Apr 2009 21:34:29 +0000 (23:34 +0200)
find_loop_by_file() uses an internal buffer of 20 chars, which is compared
to a buffer of the size of 64 chars. Not good.

References: 436428

Signed-off-by: Hannes Reinecke <hare@suse.de>
kpartx/lopart.c

index 33f312b..79d8328 100644 (file)
@@ -105,7 +105,7 @@ is_loop_device (const char *device)
 extern char *
 find_loop_by_file (const char * filename)
 {
-       char dev[20];
+       char dev[64];
        char *loop_formats[] = { "/dev/loop%d", "/dev/loop/%d" };
        int i, j, fd;
        struct stat statbuf;