security - possible to leak in-memory data from one ios app to another? -


preface: i'm not ios developer , know next nothing ios security model. forgive me if question dumb. :)

consider app, called myapp, following when launched:

  1. dynamically allocates chunk of memory, using malloc().
  2. loads sensitive data on network , stores in chunk of memory.
  3. sits there doing nothing.

now consider following scenario:

  1. user launches myapp.
  2. user closes myapp.
  3. user launches someotherapp.

my question: if someotherapp dynamically allocates memory possible 1 of buffers returned os contain sensitive data placed there (now closed) invocation of myapp?

or contents of ram treated part of sandbox in app runs?

theoretically once user closes app (you have make sure app closed , not running in background) memory allocated process deallocated , returned.

to quote tutorial on arc:

"with automatic reference counting enabled, compiler automatically insert retain, release , autorelease in correct places in program. no longer have worry of this, because compiler you."

so when app closes, references objects had sort of memory allocation cleared because there no objects reference when app not running.

the reason have make sure closed because apps, default, not close when press home button, in fact continue run in background. might cause potential security threat, unlikely. ensure no memory still being held on app, make sure closes each time. make sure code done right , person writing it, knows , keeping track of memory allocates.

if security big issue, make sure of memory allocated deallocated in code. make sure insane amount of testing memory leaks , whatnot make sure no object left lying amount of memory.

i not professional on memory management of arc, best check couple other sources ensure answer correct.

if have spoken in err, hit me.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -