Author: akhaldi
Date: Sat May 30 10:24:29 2015
New Revision: 67965
URL:
http://svn.reactos.org/svn/reactos?rev=67965&view=rev
Log:
[NETAPI32] Fix array index use before limits check. By Kudratov Olimjon using Cppcheck.
CORE-8978
Modified:
trunk/reactos/dll/win32/netapi32/nbt.c
Modified: trunk/reactos/dll/win32/netapi32/nbt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/nbt.c?r…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/nbt.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/nbt.c [iso-8859-1] Sat May 30 10:24:29 2015
@@ -163,7 +163,7 @@
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';