% diff -u vfdecrypt.c.ori vfdecrypt.c --- vfdecrypt.c.ori 2007-07-04 16:07:32.000000000 +0200 +++ vfdecrypt.c 2007-07-04 16:06:44.000000000 +0200 @@ -120,9 +120,10 @@ int bytelen = (slen+1)/2; int rpos, wpos = 0; - while(wpos < maxlen - bytelen) bytes[wpos++] = 0; + while(wpos < maxlen) bytes[wpos++] = 0; + wpos = 0; - for(rpos = 0; rpos < bytelen; rpos++) { + for(rpos = 0; rpos < maxlen; rpos++) { sscanf(&str[rpos*2], "%02hhx", &bytes[wpos++]); } } @@ -341,10 +342,14 @@ uint8_t hmacsha1_key[20], aes_key[16], inbuf[CHUNK_SIZE], outbuf[CHUNK_SIZE]; uint32_t chunk_no; int hdr_version, c,i, optError = 0; - char inFile[512] = "", outFile[512] = "", passphrase[512]; + char inFile[512], outFile[512], passphrase[512]; int iflag = 0, oflag = 0, pflag = 0, kflag = 0, verbose = 0; extern char *optarg; extern int optind, optopt; + + memset(inFile, 0, 512); + memset(outFile, 0, 512); + memset(passphrase, 0, 512); while((c = getopt(argc, argv, "hvi::o::p:k:")) != -1) { switch(c) {