mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 09:01:16 +00:00
Bug 170379: fix the stack overflow crash by not allocating the 32K "sieve"
array on the stack.
This commit is contained in:
parent
25e0d3e6a1
commit
fda8e75512
@ -428,7 +428,8 @@ mp_err mpp_make_prime(mp_int *start, mp_size nBits, mp_size strong,
|
||||
* Mac builds don't break by adding an extra variable
|
||||
* on the stack. -javi
|
||||
*/
|
||||
#if defined(macintosh) || defined (XP_OS2)
|
||||
#if defined(macintosh) || defined (XP_OS2) \
|
||||
|| (defined(HPUX) && defined(__ia64))
|
||||
unsigned char *sieve;
|
||||
|
||||
sieve = malloc(SIEVE_SIZE);
|
||||
@ -570,7 +571,8 @@ CLEANUP:
|
||||
mp_clear(&q);
|
||||
if (nTries)
|
||||
*nTries += i;
|
||||
#if defined(macintosh) || defined(XP_OS2)
|
||||
#if defined(macintosh) || defined(XP_OS2) \
|
||||
|| (defined(HPUX) && defined(__ia64))
|
||||
if (sieve != NULL) {
|
||||
memset(sieve, 0, SIEVE_SIZE);
|
||||
free (sieve);
|
||||
|
Loading…
Reference in New Issue
Block a user