提交 50259a13 编写于 作者: M Matias Devenuta

Fix UnityPrintFloat() buffer overflow

UnityPrintFloat() overflowed with some inputs (eg. FLT_MAX)
上级 f31667ad
......@@ -283,7 +283,7 @@ void UnityPrintMask(const _U_UINT mask, const _U_UINT number)
void UnityPrintFloat(_UF number)
{
char TempBuffer[32];
sprintf(TempBuffer, "%.6f", number);
snprintf(TempBuffer, sizeof(TempBuffer), "%.6f", number);
UnityPrint(TempBuffer);
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册