freemyipod r587 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r586‎ | r587 | r588 >
Date:19:07, 12 February 2011
Author:theseven
Status:new
Tags:
Comment:
libemcore.py: Fix null pointer dereference
Modified paths:
  • /emcore/trunk/tools/libemcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/libemcore.py
@@ -385,7 +385,9 @@
386386 threadstruct = threadstruct._to_bunch()
387387 threadstruct.id = id # only for the purpose of detecting the idle thread as it is always the first one
388388 threadstruct.addr = structptr
389 - threadstruct.name = self.readstring(threadstruct.name)
 389+ if threadstruct.name != 0:
 390+ threadstruct.name = self.readstring(threadstruct.name)
 391+ else: threadstruct.name = "[Thread %08X]" % structptr
390392 threadstruct.state = thread_state(threadstruct.state)
391393 threads.append(threadstruct)
392394 id += 1