View Single Post
  #7   (View Single Post)  
Old 23rd September 2011
ocicat ocicat is offline
Join Date: Apr 2008
Posts: 3,295

Originally Posted by xmorg View Post
Program received signal EXC_BAD_ACCESS, Could not access memory.                
Reason: KERN_INVALID_ADDRESS at address: 0x00007fff6076d300                     
0x00007fff80c8ec00 in strlen ()
...which is the tell-tale sign of a string which isn't NULL-terminated.

I haven't looked at your code yet (maybe this weekend if it is relatively small...), but is there a reason why you are creating such an elaborate structure based on pointers, calls to malloc(), etc.? Why not pre-allocate a fixed size array at compilation time? There can be valid reasons for allocating everything from the heap, but you take on deciphering the structure as a result.
Reply With Quote