缓冲区溢出漏洞
#include "string.h"#include "stdio.h"
char buf[255], pass[4];
int main (int argc , char* argv[ ])
{
while(1)
{
printf("请输入您的密码:");
scanf("%s" ,buf);
strcpy(pass , buf);
if (strcmp(pass,"wlqs")==0)
printf ("输入正确!\n");
else printf("输入错误!\n");
printf("%d\n",main);
}
return 0;
}
这是一道缓冲区溢出漏洞的问题,请问怎样重复输入能正确