阅读背景:

在x86-32上的C中的堆栈溢出和分段故障

来源:互联网 

i have a question regarding a stack overflow in C. I wrote a little testing program, so when i start it with 8 As, i get what i expect, i write over the borders of the second buf and therefor buf1 is empty, because the trailing zero is first element in buf1 now. So far so good, if i try it with 16 As it also works, event with 17 As. But i would expect a segfault here ... the segfault comes up after 24 As. Why is that? I tested on x86-32 ubuntu, debian and suse. Always segfault after 24 Byte... On an AMD64 System with same code i get segfault after 32 As, just as i expected it ... But why on x86-32 after 24????i have a question regarding a stack overflow in




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: