From 1c0b06fae9bb46222c1739d7006645b4b5f00f69 Mon Sep 17 00:00:00 2001 From: junmin kim Date: Mon, 22 May 2017 21:15:52 -0700 Subject: [PATCH] pthread : Add null check at pthread_getstacksize Without this condition, null dereference assert will occur --- lib/libc/pthread/pthread_attrgetstacksize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/pthread/pthread_attrgetstacksize.c b/lib/libc/pthread/pthread_attrgetstacksize.c index 605a45e..415ef01 100644 --- a/lib/libc/pthread/pthread_attrgetstacksize.c +++ b/lib/libc/pthread/pthread_attrgetstacksize.c @@ -106,7 +106,7 @@ int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, FAR long *stacksiz sdbg("attr=0x%p stacksize=0x%p\n", attr, stacksize); - if (!stacksize) { + if (!attr || !stacksize) { ret = EINVAL; } else { *stacksize = attr->stacksize; -- 2.7.4