Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Shortest way to segfault on C

Name: Anonymous 2009-10-17 15:47

main(){main();}

Name: Anonymous 2009-10-18 9:45

>>14
So what, it's a prototype declaration?
Variable declaration (without initializing it)... hmm, what are global variables initialized to?  They can't very well take on a random value, because they aren't allocated on the stack, right? I know static globals are zeroed.
Also, wtf is main=5; doing? Declaring main as an int, assiging 5 and then making libc attempt to call a variable?
Correct. Calling a variable is equivalent to jumping to its position, then executing the bytes that represent it (and subsequent data).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List