]> git.proxmox.com Git - mirror_edk2.git/commitdiff
add security check.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 19 May 2010 01:49:34 +0000 (01:49 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 19 May 2010 01:49:34 +0000 (01:49 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10513 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c

index f36a5bd1bf1a7da4cd20bb08c0a34c469812d998..245da8637d0b29e472186b7e82e06c9f1d987283 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Misc support routines for tcp.\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -171,7 +171,7 @@ TcpInitTcbPeer (
   @param  Local                 Pointer to the local (IP, Port).\r
   @param  Remote                Pointer to the remote (IP, Port).\r
 \r
-  @return  Pointer to the TCP_CB with the least number of wildcard, \r
+  @return  Pointer to the TCP_CB with the least number of wildcard,\r
            if NULL no match is found.\r
 \r
 **/\r
@@ -500,6 +500,9 @@ TcpSetState (
   IN     UINT8   State\r
   )\r
 {\r
+  ASSERT (Tcb->State < (sizeof (mTcpStateName) / sizeof (CHAR16 *)));\r
+  ASSERT (State < (sizeof (mTcpStateName) / sizeof (CHAR16 *)));\r
+\r
   DEBUG (\r
     (EFI_D_INFO,\r
     "Tcb (%p) state %s --> %s\n",\r