fs/mqueue/mq_open.c: Add the judgment for mq_attr is NULL.
Signed-off-by: yangjiao <yangjiao@xiaomi.com>
This commit is contained in:
parent
bef756c004
commit
a543950951
|
@ -191,12 +191,15 @@ static int file_mq_vopen(FAR struct file *mq, FAR const char *mq_name,
|
||||||
|
|
||||||
mode = va_arg(ap, mode_t);
|
mode = va_arg(ap, mode_t);
|
||||||
attr = va_arg(ap, FAR struct mq_attr *);
|
attr = va_arg(ap, FAR struct mq_attr *);
|
||||||
|
if (attr != NULL)
|
||||||
|
{
|
||||||
if (attr->mq_maxmsg <= 0 || attr->mq_msgsize <= 0)
|
if (attr->mq_maxmsg <= 0 || attr->mq_msgsize <= 0)
|
||||||
{
|
{
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mode &= ~umask;
|
mode &= ~umask;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue