High Definition Standard Definition Theater
Video id : X7uj_uGTOfk
ImmersiveAmbientModecolor: #ede4e6 (color 1)
Video Format : 22 (720p) openh264 ( https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz
Audio Format: Opus - Normalized audio
PokeTubeEncryptID: cf415eb2159c8d102bd9173f116c1251a718c410c774294f4967fc7d7c3fc830235e9a3a6068b3e57307c828a8778eff
Proxy : eu-proxy.poketube.fun - refresh the page to change the proxy location
Date : 1715664999529 - unknown on Apple WebKit
Mystery text : WDd1al91R1RPZmsgaSAgbG92ICB1IGV1LXByb3h5LnBva2V0dWJlLmZ1bg==
143 : true
Stack Corruption – The Programmer’s Biggest Nightmare (Program C In Visual Studio Course)
Jump to Connections
1,198 Views • May 4, 2022 • Click to toggle off description
If you really want to mess up a program, try corrupting the stack.
But maybe you don’t even know what the stack is or where to find it? So surely you won’t be able to corrupt it…
In fact, corrupting the stack is incredibly easy to do in a C program. In the previous lesson in this course, I explained buffer overflows. It’s easy to cause a buffer overflow – just by reading strings from the system prompt. And when you have a buffer overflow there is a good chance that you will also corrupt the stack.
In this lesson, I explain the stack and why it is so easy to mess up!

To follow the course in order, bookmark the playlist:
   • Program C in Visual Studio  

MORE ON RECURSION
====================
To help you understand the stack, it is also useful to understand how frames are added to the stack during function calls – even recursive function calls. I have a lesson on this here:
   • What Are The Call Stack And Stack Fra...  

PROGRAMMING BOOKS
====================
If you want to learn C in more depth (and also support this channel!) you might think of buying one of my books. I have written books on C programming, Using Pointers in C, Recursion and other programming topics.

** The Little Book Of C Programming **
Amazon (US) amzn.to/2RXwA6a
Amazon (UK) amzn.to/2JhlwOA

GET THE SOURCE CODE
=================================
Download the source code of the projects in this course (the archive for “The Little Book Of C”) from:
www.bitwisebooks.com/

“CODE WITH HUW” ON TWITTER:
=================================
twitter.com/codewithhuw

“CODE WITH HUW” ON FACEBOOK:
=================================
www.facebook.com/CodeWithHuw

Good luck! And good programming!
Metadata And Engagement

Views : 1,198
Genre: Education
Date of upload: May 4, 2022 ^^


Rating : 5 (0/62 LTDR)
RYD date created : 2024-05-13T01:39:49.597605Z
See in json
Tags
Connections

YouTube Comments - 24 Comments

Top Comments of this video!! :3

@kunnudev7250

1 year ago

Awesome videos salute to you please continue awesome videos

|

@mrsjhanna

1 year ago

Hey Huw, is there going to be a follow up video to find out what to use instead of printf and scans? I am really curious now :)

1 |

@ahmadalastal5303

7 months ago

Excellent video, Subscribing ...

|

@energy-tunes

1 year ago

11:34 wont this program cause buffer overflow into last name if we tried to make the first name bigger size than its supposed to though?

|

@GaryChike

2 years ago

Very informative Huw! 🤖

|

@a21stcenturyboy.60

2 years ago

This is a great channel. I really wish I found this video months ago. I started learning C with javascript background and it was like a cultural shock but it was fun to code with after some time. I came through buffer overflow bug and I didn t know about it at the time some random variables kept changing. I used sprintf and it corrupted my data for large inputs. This made me hate C as it took me quite a while to figure it out and that freaked me out I didn t even start with node based data structures or guis or frameworks and I was so slow at learning and coding

1 |

@NikolaNevenov86

1 year ago

So...technically aren't arrays growing downwards as well..I mean their addresses. last name array's address is 8 bytes lower than first name. It's just that the array is being read backwards(upwards) thus it's first element is the last in memory. Also just out of curiosity, do you know why it was designed that way? I mean everything to go downwards in memory but internally arrays to read and store upwards? Also when using pointer arithmetic to modify an pointer of an array, should we use ++ or -- ? I mean if an array is going upwards in memory thus we should be looking not for the next memory address but the previous?

|

@alexrossouw7702

1 year ago

So, switching from debug to release mode may generate bugs. That irony must bite real hard on a Friday afternoon because of Monday morning's poorly written code

|

@solidfuel0

1 year ago

The whole coding will disappear in the future

|

Go To Top