Opps, I pasted the diff, not the patch. This should work (cd /pentest/passwords/crunch && patch -p1 -i crunch.patch):
Code:
diff -crB crunch/crunch.c crunch2/crunch.c
*** crunch/crunch.c 2010-01-26 16:16:50.000000000 -0600
--- crunch2/crunch.c 2010-01-26 22:31:33.000000000 -0600
***************
*** 272,278 ****
FILE *optr; /* ptr to output file */
errno=0;
! block = (char*) calloc(end,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);
--- 272,278 ----
FILE *optr; /* ptr to output file */
errno=0;
! 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,498 ****
}
if ((argc >= 4) && (strncmp(argv[3],"-",1) != 0)) { /*test for ./crunch 1 2 -? */
! charset = (char*) calloc(strlen(argv[3]),sizeof(char)); /* user specified charset */
if (charset == NULL) {
printf("crunch: can't allocate memory for charset\n");
return -1;
--- 492,498 ----
}
if ((argc >= 4) && (strncmp(argv[3],"-",1) != 0)) { /*test for ./crunch 1 2 -? */
! 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;