Whamcloud - gitweb
e2fsck: Avoid core dump when using the -N option
authorTheodore Ts'o <tytso@mit.edu>
Sat, 29 Mar 2008 18:46:48 +0000 (14:46 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 29 Mar 2008 18:46:48 +0000 (14:46 -0400)
This bug was accidentally introduced by commit 1dc506cb.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/unix.c

index 3eb3064..d3a8a2b 100644 (file)
@@ -737,7 +737,7 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
                        break;
 #endif
                case 'N':
-                       ctx->device_name = optarg;
+                       ctx->device_name = string_copy(ctx, optarg, 0);
                        break;
 #ifdef ENABLE_SWAPFS
                case 's':