]> err.no Git - util-linux/commitdiff
agetty: fix short malloc in initstring handling
authorLaMont Jones <lamont@mmjgroup.com>
Tue, 17 Jul 2007 23:47:33 +0000 (17:47 -0600)
committerKarel Zak <kzak@redhat.com>
Wed, 25 Jul 2007 16:56:38 +0000 (18:56 +0200)
Signed-off-by: LaMont Jones <lamont@mmjgroup.com>
login-utils/agetty.c

index d5359d2c43bef60a6285c069d197a15157fbb8b6..ff27b70bad87880c90f1be8e9112c302dd54f75b 100644 (file)
@@ -418,7 +418,7 @@ parse_args(argc, argv, op)
            op->eightbits = 1;
            break;
        case 'I':
-           if (!(op->initstring = malloc(strlen(optarg)))) {
+           if (!(op->initstring = malloc(strlen(optarg)+1))) {
                error(_("can't malloc initstring"));
                break;
            }