提交 b8adc45c 编写于 作者: O openharmony_ci 提交者: Gitee

!181 fix:fopen入参校验不全导致访问异常

Merge pull request !181 from Zhaotianyu/cherry-pick-1640158714
......@@ -12,7 +12,7 @@ FILE *fopen(const char *restrict filename, const char *restrict mode)
int flags;
/* Check for valid initial mode character */
if (!strchr("rwa", *mode)) {
if ((mode == NULL) || (!strchr("rwa", *mode))) {
errno = EINVAL;
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册