Yes. I am not incrementing SessionNum in the first place, so it remains at
0. PcapSession[0] is also not null. When I was debugging my application
further, I see that header->caplen and header->len blow up (for instance,
caplen becomes 1511663 - something like that - unlike the previous
iterations when it was a 2-3 digit number) immediately after the "green
arrow" points to the line "while((res =
pcap_next_ex(PcapSession[SessionNum], &header, &pkt_data))>= 0)". Would this
info help, or is the blowup happening because the header has nothing in it
in the first place?

-----Original Message-----
From: Guy Harris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 15, 2004 4:03 PM
To: [EMAIL PROTECTED]
Subject: Re: [WinPcap-users] pcap_next_ex and buffer overflow



On Sep 15, 2004, at 10:49 AM, Venkatramani, Bharath wrote:

> I am using winpcap 3.0 and have been having this problem for some time 
> now.
> I am calling my DLL from Labview 7.1 and everytime I run my program in 
> debug
> mode, I get an error saying that labview has encountered a reading 
> access
> violation at 0x0000005 (something to that extent). Then I get a green 
> arrow
> pointing to this statement in my code:
>
> |>    while( (res = pcap_next_ex(PcapSession[SessionNum], &header,
> &pkt_data))>= 0)
>       {
>               ...
>       }

Are you certain that

        1) SessionNum is nonnegative and is less than the number of elements

in the PcapSession array

and, if that's true,

        2) PcapSession[SessionNum] is non-null?

If not, then you need to change your code to make sure both of those 
are true.



==================================================================
 This is the WinPcap users list. It is archived at
 http://www.mail-archive.com/[EMAIL PROTECTED]/

 To unsubscribe use 
 mailto: [EMAIL PROTECTED]
==================================================================


==================================================================
 This is the WinPcap users list. It is archived at
 http://www.mail-archive.com/[EMAIL PROTECTED]/

 To unsubscribe use 
 mailto: [EMAIL PROTECTED]
==================================================================

Reply via email to