Commit f53b2588 authored by Thomas Faber's avatar Thomas Faber Committed by Alexandre Julliard

netapi32: Avoid buffer overrun in NetBTNameEncode.

parent 28851700
......@@ -171,7 +171,7 @@ static int NetBTNameEncode(const UCHAR *p, UCHAR *buffer)
if (!buffer) return 0;
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] & 0x0f) + 'A';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment