Last active
January 14, 2018 07:48
-
-
Save jmcph4/95c3220ae04e9dea3ece19b0cb4285d0 to your computer and use it in GitHub Desktop.
Simple toy program in C that greets the user with their desired name (fuzzing target)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define N 16 /* buffer size */ | |
int main(void) { | |
char name[N]; /* buffer */ | |
/* prompt user for name */ | |
printf("What's your name? "); | |
scanf("%s", name); | |
printf("Hi there, %s!\n", name); /* greet the user */ | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that, in the initial commit, line 11 passed a pointer to
name
. Compiling withgcc name.c -Wall -Wextra -Wshadow -pedantic -std=c11 -g3 -o name
produced the following warning: