      program pointers
          implicit none
          integer, pointer :: p2(:) !=> null()
 
          call sub
          call sub1
 
      contains
          subroutine sub
              integer, target :: p1(40)
 
              p2 => p1
              p1 = 32
          end subroutine
 
          subroutine sub1
              call corrupt_stack
          end subroutine sub1
 
!
!   The following function can overwrite its return address.
!
          subroutine corrupt_stack
              p2 = 1234
          end subroutine corrupt_stack
      end
 
