[Wine-patches] rpcrt4: Use memcpy instead of strcpy to prevent a crash.

Alexander Morozov amorozov на etersoft.ru
Чт Июл 16 16:01:12 MSD 2009


----------- следующая часть -----------
From d99594385a4e06e9d044a3a06af7cfe2242c0079 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Thu, 16 Jul 2009 15:57:01 +0400
Subject: [PATCH] rpcrt4: Use memcpy instead of strcpy to prevent a crash.

---
 dlls/rpcrt4/rpc_message.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c
index cddfbd5..8d27a8c 100644
--- a/dlls/rpcrt4/rpc_message.c
+++ b/dlls/rpcrt4/rpc_message.c
@@ -269,7 +269,7 @@ RpcPktHdr *RPCRT4_BuildBindAckHeader(ULONG DataRepresentation,
   header->bind_ack.assoc_gid = AssocGroupId;
   server_address = (RpcAddressString*)(&header->bind_ack + 1);
   server_address->length = strlen(ServerAddress) + 1;
-  strcpy(server_address->string, ServerAddress);
+  memcpy(server_address->string, ServerAddress, server_address->length);
   /* results is 4-byte aligned */
   results = (RpcResults*)((ULONG_PTR)server_address + ROUND_UP(FIELD_OFFSET(RpcAddressString, string[server_address->length]), 4));
   results->num_results = 1;
-- 
1.6.3.3



Подробная информация о списке рассылки Wine-patches