Home GnuPG

mceliece6688128f: fix stack overflow crash on win64/wine
b17ed8d1af20Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

mceliece6688128f: fix stack overflow crash on win64/wine

* cipher/mceliece6688128f.c (pk_gen): Remove 'mat' array allocation and
rename function to ...
(pk_gen_mat): ... this.
(pk_gen): New wrapper for 'pk_gen_mat' with dynamic allocation of 'mat'
array.

Cherry-pick master commit of:
5bd932017116f0edf49641d56382356b4c5c876e

Huge array allocations from stack are not always guaranteed to work on
every target platform, so avoid allocating multi-megabyte 'mat' array
from stack.

v2: zero 'mat' array after use.
v3: use 'const size_t' type for 'sizeof_mat'.

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Sep 26 2025, 8:45 AM
gniibeCommitted on Nov 20 2025, 2:27 AM
Parents
rCf4fda2acfaed: mceliece6688128f: fix UBSAN runtime errors
Branches
Unknown
Tags
Unknown

Event Timeline