There exists a bug in crunch version 1.8 where junk characters from memory will be output because of improper string initialization.

For example: ./crunch 1 1 abcdefghijklmnopqrstuvwxyz0123456789 will output 37 lines, the last one being junk from memory. The problem exists with any length of output chosen. If you modify the charset then sometimes memory will be initialized in a way that this issue won't be seen (for example, calloc might jump to memory a few bytes forward).

Here is a patch:
Code:
--- crunch.c_orig	2010-01-26 16:16:50.000000000 -0600
+++ crunch.c	2010-01-26 16:18:55.000000000 -0600
@@ -272,7 +272,7 @@
 FILE *optr;        /* ptr to output file */
 errno=0;
 
-  block = (char*) calloc(end,sizeof(char)); /* block can't be bigger than max size */
+  block = (char*) calloc(end+1,sizeof(char)); /* block can't be bigger than max size */
   if (block == NULL) {
     printf("crunch: can't allocate memory for block\n");
     exit(EXIT_FAILURE);
@@ -492,7 +492,7 @@
   }
 
   if ((argc >= 4) && (strncmp(argv[3],"-",1) != 0)) { /*test for ./crunch 1 2 -? */
-    charset = (char*) calloc(strlen(argv[3]),sizeof(char)); /* user specified charset */
+    charset = (char*) calloc(strlen(argv[3])+1,sizeof(char)); /* user specified charset */
     if (charset == NULL) {
       printf("crunch: can't allocate memory for charset\n");
       return -1;