Stack Smashing Detected

32 views
Skip to first unread message

Shing Wan Choi

unread,
Feb 23, 2017, 11:21:49 AM2/23/17
to plink2-dev
When performing Clumping, sometime I will encounter the error:

*** stack smashing detected ***

After searching online, it was suggested that it might be a buffer overflow. After spending sometime looking into the code, it seems like in the 

em_phase_hethet

function, it is possible for the sol_end_idx equals to 3, which causes a buffer overflow in line 4939. Should that line be 

if (solutions[sol_end_idx-1] > half_hethet_share) {
solutions[sol_end_idx-1] = half_hethet_share;
}

instead?

Thanks


Christopher Chang

unread,
Feb 23, 2017, 11:48:01 AM2/23/17
to plink2-dev
Yes, this analysis looks correct to me; thanks for reporting it!  I will post a build with this change later today; let me know if you still get "stack smashing detected" errors afterward.
Reply all
Reply to author
Forward
0 new messages