Commit 43f6477
Fix buffer overflow vulnerabilities in ai/game_ai.c
Replace unsafe strcpy/strcat calls with safe strlcpy/strlcat to prevent
buffer overflow attacks. The original code could overflow the 1024-byte
buffers if input strings were too long.
Security impact:
- Prevents potential arbitrary code execution via buffer overflow
- Adds proper length validation for constructed file paths
- Uses RetroArch's existing safe string functions consistently
Affected functions:
- game_ai_load(): Fixed g_game_name buffer overflow
- game_ai_think(): Fixed data_path construction overflow1 parent f2e32f0 commit 43f6477
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
184 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
| |||
0 commit comments