mirror of
https://github.com/opnsense/src.git
synced 2026-04-24 23:57:30 -04:00
Avoid reading pass the end of the source buffer when it is not NUL
terminated. If this buffer is adjacent to an unmapped page or a version of C with bounds checked is used this may result in a crash. PR: 206177 Submitted by: Alexander Cherepanov <cherepan@mccme.ru> MFC after: 1 week
This commit is contained in:
parent
e12a9f251e
commit
cd3dbc2573
1 changed files with 1 additions and 1 deletions
|
|
@ -48,7 +48,7 @@ wcsncat(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n)
|
|||
p++;
|
||||
q = p;
|
||||
r = s2;
|
||||
while (*r && n) {
|
||||
while (n && *r) {
|
||||
*q++ = *r++;
|
||||
n--;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue