Add TD8
This commit is contained in:
parent
7c934bcefb
commit
453d88282f
8 changed files with 588 additions and 0 deletions
19
content/secu_logicielle/td8-gdb/files/modif3.c
Normal file
19
content/secu_logicielle/td8-gdb/files/modif3.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void f(char *x, int n) {
|
||||
memset(x, '\0', n);
|
||||
}
|
||||
|
||||
void g(char *y, int n) {
|
||||
return f(y, n);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
char *a = strdup("aaa");
|
||||
g(a, sizeof(a)+1);
|
||||
printf("%p\n", &a);
|
||||
free(a);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue