netapi32: Avoid buffer overrun in NetBTNameEncode.
Signed-off-by: Thomas Faber <thomas.faber@reactos.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2885170057
commit
f53b2588af
|
@ -171,7 +171,7 @@ static int NetBTNameEncode(const UCHAR *p, UCHAR *buffer)
|
||||||
if (!buffer) return 0;
|
if (!buffer) return 0;
|
||||||
|
|
||||||
buffer[len++] = NCBNAMSZ * 2;
|
buffer[len++] = NCBNAMSZ * 2;
|
||||||
for (i = 0; p[i] && i < NCBNAMSZ; i++)
|
for (i = 0; i < NCBNAMSZ && p[i]; i++)
|
||||||
{
|
{
|
||||||
buffer[len++] = ((p[i] & 0xf0) >> 4) + 'A';
|
buffer[len++] = ((p[i] & 0xf0) >> 4) + 'A';
|
||||||
buffer[len++] = (p[i] & 0x0f) + 'A';
|
buffer[len++] = (p[i] & 0x0f) + 'A';
|
||||||
|
|
Loading…
Reference in New Issue