Hello!
Is it possible to add a trailing zero to the INTERMEDIATE_BUFFER::m_IBuffer field from common.h for WinpktFilter program? The reason I need it is that I’m doing quite extensive parsing of the HTTP packets.. and I don’t want to copy every packet’s content just to parse it. So I’m using standard library functions like strstr and so on directly on (Packet.m_IBuffer + some_offset) field. They need NULL-terminated string as input. m_IBuffer is not NULL-terminated. So in order to solve this problem I simply wrote like this:
struct _INTERMEDIATE_BUFFER
{
……..
UCHAR m_IBuffer [MAX_ETHER_FRAME + 1];
} INTERMEDIATE_BUFFER, *PINTERMEDIATE_BUFFER;
and added one more line like this:
while(api.ReadPacket(&Request))
{
PacketBuffer.m_IBuffer[PacketBuffer.m_Length] = 0;
……
}
So my question is – is it safe? It works so far… but I just want to ask the developer 😉 May be you are making some assumptions about INTERMEDIATE_BUFFER deep inside the driver?.. Or you can give me some other ways to solve my problem?
Thanks a lot in advance,
Alexey