Repository navigation
Commit 2e88d72
committed
fix(windows): use wcsnlen for defensive programming (CWE-126)
Replace wcslen with wcsnlen in Utf8FromUtf16 function to provide
an extra safety bound against potential buffer over-reads.
While the current usage is safe (input from Windows APIs is guaranteed
null-terminated), this change follows security best practices and
resolves warnings from security scanners like Semgrep/GitLab SAST.
Fixes flutter#1804181 parent 16dfe7f commit 2e88d72
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
0 commit comments