R6001 Error not detected with /NULL switch.

0 Likes

Problem:

BOUNDS-CHECKER does not detect an overwrite to the  Copywrite block of the Data Segment (Run Time Error R6001 - null   pointer assignment) when the /NULL switch has been selected.

Resolution:

The size of the Copyright block varies depending on

  the compiler and its version. BOUNDS-CHECKER uses a value of 40H as

  the size of this block, but in some cases the block may be larger.

You can determine the size of this block from the .MAP file. For

  Microsoft programs, use the size of the module named "NULL" in the

  first section of the .MAP file. For Borland programs, use the size

  of the procedure named "DATASEG@" within the "Publics by Value"

  section. The example below shows how to patch BCHK.EXE to increase

  the size protected by BOUNDS-CHECKER to 45H:

ren bchk.exe bchk.bin

debug bchk.bin

-r      (get contents of CS register)

-s CS 1000:0 lffff bf 40 00

(prints an address in xxxx:yyyy format)

-e address 1 45     (Change the 40 to 45)

-w

-q

ren bchk.bin bchk.exe

  NOTE: If BOUNDS-CHECKER is being run with Soft-ICE installed, a

  similar patch must be made to Soft-ICE, because when Soft-ICE is

  installed, BOUNDS-CHECKER uses the Soft-ICE routines. The location

  is within the first 64K of Soft-ICE, so the patch sequence will be

  as follows:

ren s-ice.exe s-ice.bin

debug s-ice.bin

-s 0:0 lffff bf 40 00

prints an address in xxxx:yyyy format)

-e address 1 45     (Change the 40 to 45)

-w

-q

ren s-ice.bin s-ice.exe

Old KB# 12298
Comment List
Anonymous
Related Discussions
Recommended