Author: tkreuzer
Date: Mon Dec 27 09:18:00 2010
New Revision: 50155
URL: http://svn.reactos.org/svn/reactos?rev=50155&view=rev
Log:
[NSLOOKUP]
Use memcpy with sizeof instead of strncpy with strlen to make sure the destination string will be zero terminated.
CID 1649
Modified:
trunk/reactos/base/applications/network/nslookup/nslookup.c
Modified: trunk/reactos/base/applications/network/nslookup/nslookup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/nslookup/nslookup.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/nslookup/nslookup.c [iso-8859-1] Mon Dec 27 09:18:00 2010
@@ -791,7 +791,7 @@
RtlZeroMemory( State.DefaultServer, 256 );
RtlZeroMemory( State.DefaultServerAddress, 16 );
- strncpy( State.root, DEFAULT_ROOT, strlen( DEFAULT_ROOT ) );
+ memcpy( State.root, DEFAULT_ROOT, sizeof(DEFAULT_ROOT) );
/* We don't know how long of a buffer it will want to return. So we'll
pass an empty one now and let it fail only once, instead of guessing. */