#include <stdio.h>
#include <string.h>
int buff_overflow_test();
int main(void)
{
buff_overflow_test();
return 0;
}
int buff_overflow_test()
{
char buff_var3[7]; // буфер под пароль
int pass = 0; // флаг доступа
printf("\n Enter the password : \n");
gets(buff_var3);
if(strcmp(buff_var3, "pass3"))
{
printf ("\n Wrong Password \n");
}
else
{
printf ("\n Correct Password \n");
pass = 1;
}
if(pass)
{
printf ("\n Root privileges given to the user \n");
}
}