diff -urpN mcrypt-2.6.8-1.orig/src/extra.c mcrypt-2.6.8-1/src/extra.c --- mcrypt-2.6.8-1.orig/src/extra.c 2007-11-07 11:10:20.000000000 -0600 +++ mcrypt-2.6.8-1/src/extra.c 2012-09-06 14:45:34.337011563 -0500 @@ -242,6 +242,8 @@ int check_file_head(FILE * fstream, char if (m_getbit(0, sflag) != 0) { /* if the first bit is set */ *salt_size = m_setbit(0, sflag, 0); if (*salt_size > 0) { + if (*salt_size > sizeof(tmp_buf)) + err_quit(_("Salt is too long\n")); fread(tmp_buf, 1, *salt_size, fstream); memmove(salt, tmp_buf, *salt_size);