X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=dll%2Fntdll%2Fldr%2Fldrpe.c;h=1f7fa312366e6326ac417aac00a13f35f08d479b;hp=d8d235b34b2f701b9b6147df3c03f9451c7e1b01;hb=3e9cf62470c4b8cd5f7212c6bfe05d45bcaea4a2;hpb=97d0595bf6810713b4a74b2337e98d63496f2d81 diff --git a/dll/ntdll/ldr/ldrpe.c b/dll/ntdll/ldr/ldrpe.c index d8d235b34b2..1f7fa312366 100644 --- a/dll/ntdll/ldr/ldrpe.c +++ b/dll/ntdll/ldr/ldrpe.c @@ -962,7 +962,7 @@ LdrpSnapThunk(IN PVOID ExportBase, PIMAGE_IMPORT_BY_NAME AddressOfData; PULONG NameTable; PUSHORT OrdinalTable; - LPSTR ImportName = NULL; + LPSTR ImportName = NULL, DotPosition; USHORT Hint; NTSTATUS Status; ULONG_PTR HardErrorParameters[3]; @@ -1117,8 +1117,14 @@ FailurePath: { /* Get the Import and Forwarder Names */ ImportName = (LPSTR)Thunk->u1.Function; + + DotPosition = strchr(ImportName, '.'); + ASSERT(DotPosition != NULL); + if (!DotPosition) + goto FailurePath; + ForwarderName.Buffer = ImportName; - ForwarderName.Length = (USHORT)(strchr(ImportName, '.') - ImportName); + ForwarderName.Length = (USHORT)(DotPosition - ImportName); ForwarderName.MaximumLength = ForwarderName.Length; Status = RtlAnsiStringToUnicodeString(&TempUString, &ForwarderName,