70 likes | 225 Vues
This document discusses the concept of stack buffer overflow in C programming, specifically through a demonstration using a function that copies input strings without proper boundary checks. The sample code showcases a vulnerable function that may lead to buffer overflow if long strings are passed. This lab assignment is due next week on Thursday, April 11th, and aims to deepen understanding of security issues related to improper memory handling in C.
E N D
#include <string.h> void foo (char *bar) { char c[12]; strcpy (c, bar); //no bound } int main (intargc, char **argv) { foo(argv[1]); }
#include <string.h> void foo (char *bar) { char c[12]; strcpy (c, bar); //no bound } int main (intargc, char **argv) { foo(argv[1]); }
#include <string.h> void foo (char *bar) { char c[12]; strcpy (c, bar); //no bound } int main (intargc, char **argv) { foo(argv[1]); }
Lab 3 • Due next week Thursday, April 11th. • Stack buffer overflow problem, very similar to what we have described today. • Demo.