You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[MERGE #5290@xiaoyinl] Fix potential buffer overread in CountNewlines in Scan.cpp
Merge pull request #5290 from xiaoyinl:countnewlines
`cch` parameter is ignored if `psz` is not null-terminated and `psz[cch-1] == '\r'` and `psz[cch] == '\n'`. For example, `CountNewlines(_u("ab\r\na\n\n"), 3)` should return 1 (only count the first \r), but it now returns 2 (the first \r\n is skipped but the trailing \n\n are counted). The problem is that the `break` at line 26 breaks the switch, and `cch` becomes -1.
No callers actually pass `cch`, so removing it.
0 commit comments