diff -u mcrypt-2.6.8/src/extra.c mcrypt-2.6.8/src/extra.c --- mcrypt-2.6.8/src/extra.c +++ mcrypt-2.6.8/src/extra.c @@ -223,7 +223,8 @@ } read_until_null(tmp_buf, fstream); - strcpy(algorithm, tmp_buf); + strncpy(algorithm, tmp_buf, 50); + algorithm[49] = '\0'; fread(&keylen, sizeof(short int), 1, fstream); #ifdef WORDS_BIGENDIAN @@ -233,10 +234,12 @@ #endif read_until_null(tmp_buf, fstream); - strcpy(mode, tmp_buf); + strncpy(mode, tmp_buf, 50); + mode[49] = '\0'; read_until_null(tmp_buf, fstream); - strcpy(keymode, tmp_buf); + strncpy(keymode, tmp_buf, 50); + keymode[49] = '\0'; fread(&sflag, 1, 1, fstream); if (m_getbit(6, flags) == 1) { /* if the salt bit is set */ if (m_getbit(0, sflag) != 0) { /* if the first bit is set */