Skip to content

Instantly share code, notes, and snippets.

@zznop

zznop/uninit-vuln.c

Created Dec 16, 2017
Embed
What would you like to do?
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
void take_int(int j)
{
if (j == 1337)
printf("How could this be? j was never initialized!\n");
}
void recursive_func(int n)
{
static int i = 0;
i++;
if (i == 10)
return;
else
recursive_func(n);
}
void func()
{
int j;
take_int(j);
}
int main(int argc, char **argv)
{
int n = atoi(argv[1]);
recursive_func(n);
func();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.