Hello @prxy ,
You probably have a bug in your code. If you look at the documentation for C4789, you will see that it typically occurs in conjunction with use of the intrinsic versions of these functions: strcpy, memset, memcpy, wmemcpy. When compiling with optimization enabled (release mode), intrinsics are used to implement these functions; when compiling in debug mode, library calls are used. Since the compiler is responsible for generating the intrinsic statements, it is better able to detect overflow problems.
Gary