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. Safe functions after heap corruption?

Safe functions after heap corruption?

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 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.
  • C Offline
    C Offline
    chilituna
    wrote on last edited by
    #1

    Hi, I am making a custom crash handler for application, and just thought about something. I am using sprintf, strcat and strlen in handler, are they safe to use even after possible heap corruption?

    D S T C 4 Replies Last reply
    0
    • C chilituna

      Hi, I am making a custom crash handler for application, and just thought about something. I am using sprintf, strcat and strlen in handler, are they safe to use even after possible heap corruption?

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      chilituna wrote:

      I am using sprintf, strcat and strlen in handler, are they safe to use even after possible heap corruption?

      That would depend on if they were operating on heap variables or not.


      "Money talks. When my money starts to talk, I get a bill to shut it up." - Frank

      "Judge not by the eye but by the heart." - Native American Proverb

      1 Reply Last reply
      0
      • C chilituna

        Hi, I am making a custom crash handler for application, and just thought about something. I am using sprintf, strcat and strlen in handler, are they safe to use even after possible heap corruption?

        S Offline
        S Offline
        Stephen Hewitt
        wrote on last edited by
        #3

        In general, after the heap has been corrupted all bets are off.

        Steve

        1 Reply Last reply
        0
        • C chilituna

          Hi, I am making a custom crash handler for application, and just thought about something. I am using sprintf, strcat and strlen in handler, are they safe to use even after possible heap corruption?

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

          chilituna wrote:

          am using sprintf, strcat and strlen in handler, are they safe to use even after possible heap corruption?

          better not try that! you will in great trouble!

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

          1 Reply Last reply
          0
          • C chilituna

            Hi, I am making a custom crash handler for application, and just thought about something. I am using sprintf, strcat and strlen in handler, are they safe to use even after possible heap corruption?

            C Offline
            C Offline
            chilituna
            wrote on last edited by
            #5

            Hi, thanks for answers.. Went throught source code of those (sprintf, strcat, strcpy and strlen) and it seems sprintf is unsafe, since it uses malloc, but strcat,strcpy and strlen are so simple and straightforward and they don't use heap so they are probably? ok.. Well, have to replace sprintf with strcpy,strcat,strlen combination..

            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