今日のセキュリティ問題 #3
2026-11-03 の問題です。 コードを読んで、最も深刻なセキュリティ脆弱性を選んでください。
ユーザー名を受け取り、挨拶を出力する関数です。最も深刻な脆弱性はどれですか?
#include <stdio.h>
#include <string.h>
void greet(const char *name) {
char buf[32];
strcpy(buf, "Hello, ");
strcat(buf, name);
printf("%s\n", buf);
}