diff --git a/openair-cn/MME_APP/mme_app_ue_context.h b/openair-cn/MME_APP/mme_app_ue_context.h
index b84a45f4136fed7c220f5caa9adf8bc97568e787..1e2c2967e7d37a1d652b5b6c3a00797f416f5ce5 100644
--- a/openair-cn/MME_APP/mme_app_ue_context.h
+++ b/openair-cn/MME_APP/mme_app_ue_context.h
@@ -64,7 +64,7 @@ typedef uint64_t mme_app_imsi_t;
 
 /* Convert the IMSI contained by a char string NULL terminated to uint64_t */
 #define MME_APP_STRING_TO_IMSI(sTRING, iMSI) sscanf(sTRING, "%"IMSI_FORMAT, iMSI)
-#define MME_APP_IMSI_TO_STRING(iMSI, sTRING) sprintf(sTRING, "%"IMSI_FORMAT, iMSI)
+#define MME_APP_IMSI_TO_STRING(iMSI, sTRING) snprintf(sTRING, IMSI_DIGITS_MAX+1, "%"IMSI_FORMAT, iMSI)
 
 /** @struct bearer_context_t
  *  @brief Parameters that should be kept for an eps bearer.