Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. problems in Pointer overflow/underflow

problems in Pointer overflow/underflow

Scheduled Pinned Locked Moved C / C++ / MFC
c++testingbeta-testing
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    K narasimharao
    wrote on last edited by
    #1

    Testing VC++ code for pointer underflow/overflow for data type char *. knarasimharao

    K T 2 Replies Last reply
    0
    • K K narasimharao

      Testing VC++ code for pointer underflow/overflow for data type char *. knarasimharao

      K Offline
      K Offline
      khan
      wrote on last edited by
      #2

      I suppose you can check the index into the string, and the size of the string, which was allocated, so that the index should be less than the size, and always greater or equal to zero. You can use: AfxIsValidString(...) AfxIsValidAddress(...) to check that the address is readable/writable. this is this.

      T 1 Reply Last reply
      0
      • K K narasimharao

        Testing VC++ code for pointer underflow/overflow for data type char *. knarasimharao

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        so, the question is ? :confused: did you read the How to get an answer to you question[^] admin message ?


        TOXCCT >>> GEII power
        [toxcct][VisualCalc] -- modified at 6:44 Saturday 19th November, 2005

        1 Reply Last reply
        0
        • K khan

          I suppose you can check the index into the string, and the size of the string, which was allocated, so that the index should be less than the size, and always greater or equal to zero. You can use: AfxIsValidString(...) AfxIsValidAddress(...) to check that the address is readable/writable. this is this.

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          don't make the confusion : char* is not always a string !!!


          TOXCCT >>> GEII power
          [toxcct][VisualCalc]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups