文章出處
文章列表
測試代碼:
#include <stdlib.h> #include <string.h> #include <stdio.h> int main() { char pw[8] ="pass"; char in[8]; while (1) { scanf("%s", in); if (strcmp(in, pw) == 0) { printf("yesn\n"); break; } else { printf("non\n"); } } return 0; }
輸入:11111111www
輸出:no
輸入:www
輸出:yes
可以看到, 當我們輸入www的時候, 卻輸出了yes, 邏輯上面是當用戶輸入的字符串是pass的時候, 才能輸出yes ;
參考:
本文出處 :http://www.thinksaas.cn/topics/0/84/84726.html
緩沖區溢出原理解析 :http://www.cnblogs.com/fanzhidongyzby/archive/2013/08/10/3250405.html
安全漏洞是如何造成的:緩沖區溢出 :http://netsecurity.51cto.com/art/201509/490090.htm
文章列表
全站熱搜