LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Dereference of out-of-bounds pointer

i used cvi 5.5 and
when i try to go over an array that is alloc with malloc i got
"Dereference of out-of-bounds pointer : 1 bytes (1 elements) past end of array"
how i can avoid this error ?
i must do it because i use API of microsoft (GetIpNetTable)
Message 1 of 6
(5,356 Views)
Can you not call GetIpNetTable with a size of Zero initially, which should tell you how much space to allocate of size MIB_IPNETTABLE structure.
Then allocate MIB_IPNETTABLE structure + 1 or even MIB_IPNETTABLE structure * 2.

You are allocating size of MIB_IPNETTABLE structure and still getting the error ?

Regards

Chris
0 Kudos
Message 2 of 6
(5,356 Views)
there is no problem with the allocation
i have problem when i get to the table entry
the cvi has a range checking and because of that
it doesnt let me to run the line table[1]
its thinks that its have only one entry in the table
0 Kudos
Message 3 of 6
(5,356 Views)
Can you send a snippet of the code ?
0 Kudos
Message 4 of 6
(5,356 Views)
hanan wrote in message
<50650000000800000031520000-1023576873000@exchange.ni.com>...
>i used cvi 5.5 and
>when i try to go over an array that is alloc with malloc i got
>"Dereference of out-of-bounds pointer : 1 bytes (1 elements) past end
>of array"
>how i can avoid this error ?
>i must do it because i use API of microsoft (GetIpNetTable)

You can disable the user protection with the
SetBreakOnProtectionErrors function in the utility library.

See the section on user protection in chapter 1 of the
_LabWindows/CVI Programmer Reference Manual_.

--
Reed Blake
Beta Technology
Industrial and Scientific Computing
Message 5 of 6
(5,356 Views)
thanks you Reed Blake
0 Kudos
Message 6 of 6
(5,356 Views)