The strcpy_s doens't returns anything, it just crashes
This function is quite easy to understand, it copies bytes by bytes as long
it doesn't overlap.
In case of buffer overlap, that is the case in my sample, it should return
something, at least a return value ....
I never saw so far a function that voluntarily make the program crash with a
fatal error!
This is not an exception, it cannot be even catched by try method
strcpy_s function :
_FUNC_PROLOGUE
errno_t __cdecl _FUNC_NAME(_CHAR *_DEST, size_t _SIZE, const _CHAR *_SRC)
{
_CHAR *p;
size_t available;
/* validation section */
_VALIDATE_STRING(_DEST, _SIZE);
_VALIDATE_POINTER_RESET_STRING(_SRC, _DEST, _SIZE);
p = _DEST;
available = _SIZE;
while ((*p++ = *_SRC++) != 0 && --available > 0)
{
}
if (available == 0)
{
_RESET_STRING(_DEST, _SIZE);
_RETURN_BUFFER_TOO_SMALL(_DEST, _SIZE);
}
_FILL_STRING(_DEST, _SIZE, _SIZE - available + 1);
_RETURN_NO_ERROR;
}
OO2dncDtYoijDEnYnZ2dnUVZ_rGinZ2d@giganews.com...