this is the snippet of a program code :
char authenticated = 0;
char guard1 = 234;
char guard2 = 234;
//more variables initliased...
char buf[128];
&authenticated;
&guard1;
&guard2;
So what does it mean when the reference stands there as a single expression in the program code?
Edit: More Context : It's compiled with gcc on a debian server and it's related to a security project, where you can overflow the buf array.
Speaking of the meaning of the song, Vegard characterizes it as coming from "a genuine wonder of what the fox says, because we didn't know". Although interpreted by some commentators as a reference to the furry fandom, the brothers have stated they did not know about its existence when producing "The Fox".
“The Fox (What Does the Fox Say?)” by Ylvis was released in September 2013, and it's become one of the most beloved gimmick songs of the past half-decade.
On your phone, touch and hold the Home button or say "Hey Google." Ask "What's this song?" Play a song or hum, whistle, or sing the melody of a song. Hum, whistle, or sing: Google Assistant will identify potential matches for the song.
Given that this is for a security project, my guess is that these statements are designed to prevent the compiler from optimizing away the authenticated
, guard1
, and guard2
variables. If these variables aren't used later on in the function, a compliant C compiler could optimize them away, changing the layout of the stack frame for the function call.
Technically speaking, since these statements have no side-effects, the compiler could in principle optimize them away as well. However, the sense I get is that the intended compiler doesn't do this (not that it couldn't do it, just that it can't do it). That way, the layout of the stack frame will have the authenticated
variable shielded by two char
values that are not null terminators, potentially making it a bit trickier to overwrite authenticated
. Of course, it sounds like your assignment is specifically to change authenticated
, so it's not foolproof. :-)
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With