Commit 998a8a0b authored by Junchao Zhang's avatar Junchao Zhang Committed by Sangmin Seo
Browse files

Added assertion to protect cvars of type MPI_CHAR

Make sure user buf wont overflow cvar which is a string
Signed-off-by: Sangmin Seo's avatarSangmin Seo <>
parent 1b016bb2
......@@ -71,6 +71,7 @@ int MPIR_T_cvar_write_impl(MPI_T_cvar_handle handle, void *buf)
((double *)addr)[i] = ((double *)buf)[i];
case MPI_CHAR:
MPIU_Assert(count > strlen(buf)); /* Make sure buf will not overflow this cvar */
MPIU_Strncpy(addr, buf, count);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment