overmalloc_safe_strcpy?

Martin Pool mbp at samba.org
Tue Mar 18 05:11:23 GMT 2003


For developer mode, this seems to be the same as safe_strcpy: we
clobber the specified region at runtime.  Otherwise, it skips the
static CHECK_STRING_SIZE call.

I think this is meant to allow you to call it passing the address of
an array whose size is less than the maxlength passed to safe_strcpy.
CHECK_STRING_SIZE would normally trap on this because it expects
either a string pointer, or an exact fit?

Is that right?  If so I'll add a comment to this effect -- and perhaps
a plea not to use it in new code.

-- 
Martin 


More information about the samba-technical mailing list