Index: aesget.c =================================================================== --- aesget.c (revision 1678) +++ aesget.c (revision 2115) @@ -191,6 +191,7 @@ char * infile; int keysize, op; + keysize = 128; /* default to 128 bit keys */ progname= argv[0]; infile = NULL; @@ -199,7 +200,7 @@ if (op == -1) break; switch (op) { case 'k': /* keyfile */ - if ((infile = (char *)malloc(strlen(optarg))) == NULL) { + if ((infile = (char *)malloc(strlen(optarg) + 1)) == NULL) { fprintf(stderr, "malloc failed.\n"); exit(1); } Index: aescrypt.c =================================================================== --- aescrypt.c (revision 1678) +++ aescrypt.c (revision 2115) @@ -222,7 +222,7 @@ if (op == -1) break; switch (op) { case 'k': /* keyfile */ - if ((infile = (char *)malloc(strlen(optarg))) == NULL) { + if ((infile = (char *)malloc(strlen(optarg) + 1)) == NULL) { fprintf(stderr, "malloc failed.\n"); exit(1); }