libs/libnx/nxmu/: Add a few bad input parameter checks. configs/lpcxpresso-lpc54628/twm4nx/defconfig: Need to enable the NX library.

This commit is contained in:
Gregory Nutt 2019-05-12 14:42:27 -06:00
parent 611a87075c
commit 4f31eec94e
3 changed files with 6 additions and 2 deletions

View File

@ -53,6 +53,10 @@ CONFIG_MM_REGIONS=2
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LIBRARY=y
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
CONFIG_NX=y
CONFIG_NXFONT_SANS22X29B=y
CONFIG_NXFONT_SANS23X27=y

View File

@ -71,7 +71,7 @@ int nx_setsize(NXWINDOW hwnd, FAR const struct nxgl_size_s *size)
struct nxsvrmsg_setsize_s outmsg;
#ifdef CONFIG_DEBUG_FEATURES
if (!wnd || !size)
if (wnd == NULL || size == NULL || size->w < 0 || size->h < 0)
{
set_errno(EINVAL);
return ERROR;

View File

@ -76,7 +76,7 @@ int nxtk_setsize(NXTKWINDOW hfwnd, FAR const struct nxgl_size_s *size)
int ret;
#ifdef CONFIG_DEBUG_FEATURES
if (hfwnd == NULL || size == NULL)
if (hfwnd == NULL || size == NULL || size->w < 0 || size->h < 0)
{
set_errno(EINVAL);
return ERROR;