Don't allocate sieve from stack on machines with very-limited stacks.

Bug 115012.  Patch from Michael Kaply mkaply@us.ibm.com
This commit is contained in:
nelsonb%netscape.com 2001-12-18 21:49:49 +00:00
Родитель 37db3590b6
Коммит 9af2ddfe10
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -427,7 +427,7 @@ mp_err mpp_make_prime(mp_int *start, mp_size nBits, mp_size strong,
* Mac builds don't break by adding an extra variable * Mac builds don't break by adding an extra variable
* on the stack. -javi * on the stack. -javi
*/ */
#ifdef macintosh #if defined(macintosh) || defined (XP_OS2)
unsigned char *sieve; unsigned char *sieve;
sieve = malloc(SIEVE_SIZE); sieve = malloc(SIEVE_SIZE);
@ -569,7 +569,7 @@ CLEANUP:
mp_clear(&q); mp_clear(&q);
if (nTries) if (nTries)
*nTries += i; *nTries += i;
#ifdef macintosh #if defined(macintosh) || defined(XP_OS2)
if (sieve != NULL) { if (sieve != NULL) {
memset(sieve, 0, SIEVE_SIZE); memset(sieve, 0, SIEVE_SIZE);
free (sieve); free (sieve);