Message from C, C++ talks

July 2019

— Can the heap overflow the the stack somehow?

— I mean, the heap grows downwards and the stack grows upwards. Assuming the heap grows rapidly, it can overwrite the stack. Or am I missing something?

"Downwards" and "upwards" are relative to memory address layout.

Message permanent page

— Yes, can happen

— So can a memory leak vulnerability thus lead to exploitability, hence one can carefully engineer the payload to overwrite the stack with code, which redirects the control flow?

Message permanent page

— 

How to flip a bit without using conditionals or ternary operators.
negations.
bit operators. if input is 1 output is 0 is this possible?

— Whithout bitwise operators is going to be difficult, if not imposible

— It is:

typedef char bool;
#define true 1
#define false 0

— Hm, thanks for that!

— Arr = [ 1,0]
bit = arr[bit%2]

//only fir single bit

— A^1?

— That would fall under "bit operators" I think.

— Why is this program causing me a segmentation fault? https://pastebin.com/c6kZAAC1

— Use &a in scanf function

— Ohhh yess i forgot it 🤦‍♂🤦‍♂🤦‍♂

— Thanks!