ea(a)reactos.com
Make SmConnectApiPort more safe.
Modified: trunk/reactos/lib/smdll/connect.c
_____
Modified: trunk/reactos/lib/smdll/connect.c
--- trunk/reactos/lib/smdll/connect.c 2005-03-13 16:44:15 UTC (rev
14014)
+++ trunk/reactos/lib/smdll/connect.c 2005-03-13 17:00:19 UTC (rev
14015)
@@ -61,9 +61,12 @@
}
RtlZeroMemory (& ConnectData, sizeof ConnectData);
ConnectData.Subsystem = dwSubsystem;
- RtlCopyMemory (& ConnectData.SbName,
- pSbApiPortName->Buffer,
- pSbApiPortName->Length);
+ if (pSbApiPortName->Length > 0)
+ {
+ RtlCopyMemory (& ConnectData.SbName,
+ pSbApiPortName->Buffer,
+ pSbApiPortName->Length);
+ }
}
ConnectDataLength = sizeof ConnectData;
@@ -73,7 +76,7 @@
SecurityQos.EffectiveOnly = TRUE;
RtlInitUnicodeString (& SmApiPortName, SM_API_PORT_NAME);
-DbgPrint("SMDLL: calling NtConnectPort\n");
+
Status = NtConnectPort (
phSmApiPort,
& SmApiPortName,
Show replies by date