Re: NSTableView - populating from C procedure

2009-07-25 Thread Andrew Farmer
On 25 Jul 2009, at 03:56, Uli Kusterer wrote: I don't think you can use sizeof() on a pointer passed as a parameter, though. That only works on variables in the current scope. That pointer could point at anything, so the compiler has no idea whether it points at the stack or the heap. Even i

Re: NSTableView - populating from C procedure

2009-07-25 Thread Uli Kusterer
Am 23.07.2009 um 08:55 schrieb Marco S Hyman: On Jul 22, 2009, at 11:38 PM, Graham Cox wrote: My warning was of a very general nature, and may not apply to your app. But every time you declare buffer space as a stack array, you should mentally consider whether a buffer exploit might be possib

Re: NSTableView - populating from C procedure

2009-07-23 Thread Alexander Bokovikov
On 23.07.2009, at 12:55, Marco S Hyman wrote: On Jul 22, 2009, at 11:38 PM, Graham Cox wrote: My warning was of a very general nature, and may not apply to your app. But every time you declare buffer space as a stack array, you should mentally consider whether a buffer exploit might be pos

Re: NSTableView - populating from C procedure

2009-07-22 Thread Marco S Hyman
On Jul 22, 2009, at 11:38 PM, Graham Cox wrote: My warning was of a very general nature, and may not apply to your app. But every time you declare buffer space as a stack array, you should mentally consider whether a buffer exploit might be possible there. It was a good warning. Since th

Re: NSTableView - populating from C procedure

2009-07-22 Thread Graham Cox
On 23/07/2009, at 4:25 PM, Alexander Bokovikov wrote: I can it understand, when viruses send something illegal to a webserver, which has flaws in the request processing routine, but in my case it's an internal function, which, of course, should check the buffer size, but how it could be ac

Re: NSTableView - populating from C procedure

2009-07-22 Thread Alexander Bokovikov
On 23.07.2009, at 11:52, Graham Cox wrote: BTW, watch out for a potential buffer overflow in getString(...), this is the sort of thing viruses readily exploit. OK, thanks, though I'd like to ask, if it's not a big offtopic, how viruses can exploit my internal function? I can it understand,

Re: NSTableView - populating from C procedure

2009-07-22 Thread KK
Assuming your cstring is null-terminated, you can use [NSString stringWithUTF8String] On Thu, Jul 23, 2009 at 2:41 PM, Alexander Bokovikov wrote: > Hi, All, > > This is my first attempt to deal with Cocoa container class, so I have some > unclear points. I've found one of many tutorials here: > >

Re: NSTableView - populating from C procedure

2009-07-22 Thread Kyle Sluder
On Jul 22, 2009, at 10:41 PM, Alexander Bokovikov wrote: where it is said, among other, that NSTableView items may be filled out like this: Tables aren't actually filled with anything. Instead, you provide the table with a data source object that fulfills the table's data needs upon requ

Re: NSTableView - populating from C procedure

2009-07-22 Thread Graham Cox
On 23/07/2009, at 3:41 PM, Alexander Bokovikov wrote: My specifics is that the data (strings) are delivered by an external procedure, located out of ObjC stuff, and returning C-style strings. My table has only one column. My question is, as usual, about memory manager: May I write somethi