|
|||||||||||
|
Re: safe strcpy()?
From: Ed Carp <erc(at)pobox.com>
Date: Tue Jan 28 2003 - 04:44:24 EST
> There are several interesting ways to prevent the problem without making
I wasn't able to find such a function - do you have an example? Most of the buffers we use are fixed-size, to side-step problems with malloc() and free(), and so we've been able to partially get around this problem by writing strcpy() as a macro - for example: char buf[512]; our_strcpy(buf, source);
ptr = buf;
How can one determine the size of the buffer being pointed to? sizeof(ptr) returns 4 :( Technically, that's correct, but that's not what I meant ;) -- Ed Carp, N7EKG http://www.pobox.com/~erc 214/986-5870 Licensed Texas Peace Officer Computer Crime Investigation Consultant Director, Software Development Escapade Server-Side Scripting Engine Development Team http://www.squishedmosquito.com Microsoft Front Page - the official HTML editor of Al Qaeda Microsoft Hotmail - the official email of Al QaedaReceived on Tue Jan 28 12:19:43 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:45 EDT |
||||||||||
|
|||||||||||