Select Git revision
esbuild.dev.mjs
buffer-overflow-01.txt 1.04 KiB
#include <stdio.h>
int main (void)
{
char buffer[20];
gets (buffer);
printf ("Guten Tag, %s!\n", buffer);
return 0;
}
cassini/home/peter/bo/2022ss/bs/20220516> gcc -Wall -O buffer-overflow-01.c -o buffer-overflow-01
buffer-overflow-01.c: In function ‘main’:
buffer-overflow-01.c:6:3: warning: implicit declaration of function ‘gets’; did you mean ‘fgets’? [-Wimplicit-function-declaration]
gets (buffer);
^~~~
fgets
/usr/bin/ld: /tmp/cc8eISnL.o: in function `main':
buffer-overflow-01.c:(.text+0x11): Warnung:the `gets' function is dangerous and should not be used.
cassini/home/peter/bo/2022ss/bs/20220516> ./buffer-overflow-01
Peter
Guten Tag, Peter!
cassini/home/peter/bo/2022ss/bs/20220516> ./buffer-overflow-01
Prof. Dr. rer. nat. Peter Gerwinski
Guten Tag, Prof. Dr. rer. nat. Peter Gerwinski!
cassini/home/peter/bo/2022ss/bs/20220516> ./buffer-overflow-01
Prof. Dr. rer. nat. Dipl.-Phys. Peter Gerwinski
Guten Tag, Prof. Dr. rer. nat. Dipl.-Phys. Peter Gerwinski!
Speicherzugriffsfehler
cassini/home/peter/bo/2022ss/bs/20220516>